Closed Bug 1295506 Opened 4 years ago Closed 4 years ago
Don't yield hidden frames in the PNG decoder
Animated PNGs have a compatibility feature for browsers that don't support APNG: the first frame can be "hidden". APNG-compatible browsers will ignore that frame, while pre-APNG browsers will display it. This allows you to display something different to users of pre-APNG browsers. (For example, "To see this animation, use a browser that supports APNG".) The problem? Currently the PNG decoder yields after every frame, *including the hidden frame*. This causes problems in bug 1293472, because we add an assert there that says that we don't yield during a single-frame decode. That's normally true, but because we yield after a hidden frame but don't consider the decode *done* until we decode the first real frame, we trip the assert. So let's fix it.
Here's the patch. It's pretty straightforward: if the previous frame was hidden, we don't yield; we just allocate the next frame (just as we would've done when we came back from the yield) and keep on decoding.
Attachment #8781433 - Flags: review?(edwin)
Attachment #8781433 - Flags: review?(edwin) → review+
Thanks for the review!
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/9c25eb4d65d3 Don't yield hidden frames in the PNG decoder. r=edwin
You need to log in before you can comment on or make changes to this bug.