Closed Bug 621987 Opened 15 years ago Closed 15 years ago

unary - applied to unsigned var in ConvertImage

Categories

(Core :: Graphics: CanvasWebGL, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: vlad, Assigned: bjacob)

Details

Attachments

(1 file)

13:38 < vlad> bjacob_: msvc is giving a warning that I think is a problem 13:38 < vlad> in ConvertImage(), dst_delta = mPixelStoreFlipY ? -dstStride : dstStride; 13:38 < vlad> dstStride is unsigned, so applying unary - leaves it as unsigned 13:38 < vlad> which means it'll become a bignum instead of negative 13:38 < bjacob_> oh oh 13:39 < vlad> I think that needs to be -ptrdiff_t(dstStride) 13:39 < bjacob_> rather, math dstStride signed 13:39 < bjacob_> s/math/make 13:39 < bjacob_> amazing that this wouldn't have resulted in massive test failure and even crashes
Attached patch fix unsigned bugSplinter Review
OK, there's a real bug here, doing as you suggested a ptrdiff_t cast because outside of this line of code it generally makes sense for the strides to be unsigned.
Attachment #500258 - Flags: review?(vladimir)
Attachment #500258 - Flags: review?(vladimir) → review+
Attachment #500258 - Flags: approval2.0+
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: