Closed
Bug 397593
Opened 17 years ago
Closed 15 years ago
Bad fcTL CRC in APNG files ignored
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
People
(Reporter: asmith16, Assigned: glennrp+bmo)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.12 KB,
patch
|
joe
:
review+
vlad
:
superreview+
|
Details | Diff | Splinter Review |
It looks like an APNG file with a bad CRC for the fcTL chunk but otherwise valid displays without complaining. This is not ok. Best of all if it didn't disply at all. I'll look into it when I get a chance.
Assignee | ||
Comment 1•15 years ago
|
||
The spec says: Error handling APNG is designed to allow incremental display of frames before the entire image has been read. This implies that some errors may not be detected until partway through the animation. It is strongly recommended that when any error is encountered decoders should discard all subsequent frames, stop the animation, and revert to displaying the default image. A decoder which detects an error before the animation has started should display the default image. An error message may be displayed to the user if appropriate. Libpng discards the fcTL chunk with bad CRC, and continues. The APNG decoder should notice that the sequence number for the fcTL chunk is missing.
Assignee | ||
Comment 2•15 years ago
|
||
Assignee | ||
Comment 3•15 years ago
|
||
The patch will reject *any* ancillary chunk after IDAT that has a bad CRC. This is not much of a problem because we don't process any other ancillary chunks that come after IDAT anyhow.
Assignee | ||
Comment 4•15 years ago
|
||
The spec said "It is strongly recommended that when any error is encountered decoders should discard all subsequent frames, stop the animation, and revert to displaying the default image" but the patch discards all subsequent frames, stops the animation, but simply bails out rather than reverting to the default image. That would add more complexity than it's worth.
Assignee | ||
Updated•15 years ago
|
OS: Linux → All
Hardware: x86 → All
Updated•15 years ago
|
Attachment #380651 -
Flags: review?(joe) → review+
Comment 5•15 years ago
|
||
Comment on attachment 380651 [details] [diff] [review] Reject fcTL or fdAT chunk with bad CRC Yeah, this is probably the right way.
Assignee | ||
Updated•15 years ago
|
Attachment #380651 -
Flags: superreview?(tor)
Assignee | ||
Comment 6•15 years ago
|
||
This patch is *not* incorporated in the libpng-1.2.37 patch (bug #492200) since it is a libpr0n bug not a libpng bug. It needs to be sr'ed and checked in separately.
Assignee | ||
Updated•15 years ago
|
Attachment #380651 -
Flags: superreview?(tor) → superreview?(vladimir)
Assignee | ||
Comment 7•15 years ago
|
||
Note that the patch does not reject an fcTL chunk with bad CRC appearing ahead of the first IDAT. Instead the fcTL chunk will be ignored and the IDAT will be displayed. If there are subsequent good fcTL/fdAT chunks, they will be rejected because the sequence numbers are wrong. I think this behavior is OK.
Attachment #380651 -
Flags: superreview?(vladimir) → superreview+
Assignee | ||
Comment 8•15 years ago
|
||
Requesting checkin on trunk. This is probably not a serious-enough problem to bother with checking in to the branch.
Keywords: checkin-needed
Comment 9•15 years ago
|
||
Comment on attachment 380651 [details] [diff] [review] Reject fcTL or fdAT chunk with bad CRC >+ /* Reject any ancillary chunk after IDAT with a bad CRC (bug #397593). >+ * It would be better to show the default frame, if one has already >+ * been successfully decoded, before bailing but it's simpler to just Nit, shouldn't that be "decoded before bailing, but"? >+ * bail out with an error message. >+ */
Updated•15 years ago
|
Whiteboard: [c-n: wait for comment 9]
Assignee | ||
Comment 10•15 years ago
|
||
How about: * It would be better to show the default frame (if one has already been * successfully decoded) before bailing, but it's simpler to just bail * out with an error message. */
Checked in with that comment fix: http://hg.mozilla.org/mozilla-central/rev/43a9b9b923f7 Thanks!
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [c-n: wait for comment 9]
Glenn, have you got an example PNG that shows the problem you fixed here? We should turn it into a reftest.
Assignee | ||
Comment 13•11 years ago
|
||
Fixing bug #857040 has deliberately caused regression of this bug.
You need to log in
before you can comment on or make changes to this bug.
Description
•