DescriptionFix up signed-integer-overflow warnings
When checking whether a matrix was a pure scale, we subtracted
0x3f800000 from the diagonals; if the diagonal value was already
very negative, we'd underflow. Replace subtraction with XOR.
When dealing with repeating tiled bitmaps, when the bitmap was
very large, we'd multiply an offset by 65535, possibly causing
underflow. Throw in a cast to long (casting to unsigned also
silences the warning and wouldn't involve extension, but I can't
convince myself that it's correct).
BUG=skia:4635
R=mtklein@google.com
Committed: https://skia.googlesource.com/skia/+/d5c4265b49d212f7888d0516328f39c4d45d3058
Patch Set 1 #
Total comments: 1
Patch Set 2 : reed@'s verbal review #
Messages
Total messages: 10 (3 generated)
|