commit | e47f1a7c741c0ea209f7a41358557e66f27ef6a3 | [log] [tgz] |
---|---|---|
author | mtklein <mtklein@chromium.org> | Fri Nov 20 13:58:18 2015 -0800 |
committer | Commit bot <commit-bot@chromium.org> | Fri Nov 20 13:58:19 2015 -0800 |
tree | fd1e813a4ec00bcf1bb6b7170220cf600abc3fd7 | |
parent | 6c221b40680ff933c7b8f2ac3dfa76b5732aee3e [diff] |
Fix UB in SkDivBits This used to: DIVBITS_ITER was shifting bits up into the sign bit, which is a no-no. This turns numer into a uint32_t to make those defined, and adds a few notes. x >= 0 is always true for unsigned x, so we needed a few small logic refactors. Instead it now: Only call SkDivBits if the old behavior is required. Usually, just do the divide with /. BUG=skia:3562 Committed: https://skia.googlesource.com/skia/+/988adddd48322bfa3e3cb0c017cfce71fbbf1123 Committed: https://skia.googlesource.com/skia/+/6c7b104b4c08ae2332a6ce3c8c906da4e8c51e5f TBR=reed@google.com No API change. Review URL: https://codereview.chromium.org/1455163004