Closed Bug 531363 Opened 15 years ago Closed 15 years ago

incorrect test for mFlags in JPEG decoder

Categories

(Core :: Graphics: ImageLib, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jfkthame, Unassigned)

Details

Attachments

(1 file)

While trying to track down the root cause of bug 516334, noticed a typo in nsJPEGDecoder.cpp: the code uses && where & is intended (testing a bit flag). This could potentially cause it to fail to issue appropriate notifications, although fixing this does not actually resolve 516334 (which is not JPEG-specific but can occur with any image format).
Attachment #414819 - Attachment is patch: true
Attachment #414819 - Attachment mime type: application/octet-stream → text/plain
Attachment #414819 - Flags: review?(bobbyholley)
Right now this is harmless, because there's only 1 possible flag, so & and && are equivalent - so the net effect is if (mFlags), which will be either 1 or 0 depending on whether the one flag is set. http://mxr.mozilla.org/mozilla-central/source/modules/libpr0n/public/imgIDecoder.idl#68 Definitely needs to be fixed though.
Yeah, that's consistent with the observation that fixing the test didn't make any difference to the problem in 516334; it just happened to be a line of code that got looked at along the way. (I hadn't checked whether there were other possible flag values; but did notice that in all the traces I looked at, mFlags was zero anyway.)
Comment on attachment 414819 [details] [diff] [review] fix the flag test to use bitwise AND rather than logical AND r+
Attachment #414819 - Flags: review?(bobbyholley) → review+
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: