Closed Bug 1283359 Opened 9 years ago Closed 9 years ago

Use StreamingLexer in the JPEG decoder

Categories

(Core :: Graphics: ImageLib, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: seth, Assigned: seth)

References

Details

Attachments

(1 file)

The JPEG decoder is the last remaining image decoder that doesn't use StreamingLexer. See bug 1282566 comment 0 for why it's important that all image decoders use StreamingLexer.
Here's the patch. The approach is the same as in bug 1282566 - just wrap the existing decoder code in an unbuffered read. Unfortunately the existing JPEG decoder code is somewhat hairy, so the results aren't as nice, but cleaning up the JPEG decoder is something that we can put off for another bug. The only thing that really had to be updated in the existing JPEG decoder state machine was to replace simple |return| statements with |return Transition::TerminateSuccess()| or |return Transition::TerminateFailure()|. We continue setting the |mState| variable to indicate e.g. JPEG_ERROR for now, even though it's not really necessary, because there is some code continuing to look at the value in nsJPEGDecoder::FinishInternal(). We can almost certainly remove that code, but I'd prefer to do that in a separate bug.
Attachment #8766649 - Flags: review?(edwin)
Thanks for the review!
Pushed by mfowler@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/23ecfc796432 Use StreamingLexer in the JPEG decoder. r=edwin
Blocks: 1284031
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: