Closed Bug 1503935 Opened 3 years ago Closed 3 years ago

Crash due animated WebP images


(Core :: ImageLib, defect, P3)




Tracking Status
firefox-esr60 --- unaffected
firefox63 --- unaffected
firefox64 --- unaffected
firefox65 --- fixed


(Reporter: sjw+bugzilla, Assigned: aosmond)




(Keywords: crash, crashreportid)

Crash Data


(1 file)

Firefox Nightly crashes reproducible when displaying animated WebP images.
See the test cases in the referenced url.
It does not crash immediately, but after a while. At times the images flicker or do not appear at all just before crashing.

Crash ID:
Assignee: nobody → aosmond
Flags: needinfo?(aosmond)
Priority: -- → P3
Crash Signature: mozilla::image::DecoderFactory::CloneAnimationDecoder → [@ mozilla::image::DecoderFactory::CloneAnimationDecoder]
I forgot to mention, that "image.webp.enabled" need to be enabled.
I understand the crash, uber my bad. However I am seeing artifacting on the lossless animated images which is very concerning.
First we did not handle the SourceBufferIterator::WAITING state which
can happen when we get woken up but there is no data to read from the
SourceBufferIterator. StreamingLexer handled this properly by yielding
with NEED_MORE_DATA, and properly scheduling the decoder to resume. This
patch does the same in the WebP decoder.

Second nsWebPDecoder::GetType was not implemented. This meant it would
return DecoderType::UNKNOWN, and would fail to recreate the decoder if
we are discarding frames and need to restart from the beginning. In
addition to implementing that method, this patch also corrects an assert
in DecoderFactory::CloneAnimationDecoder which failed to check for WebP
as a supported animated decoder.

This patch also modestly improves the logging output and library method
(In reply to Andrew Osmond [:aosmond] from comment #2)
> I understand the crash, uber my bad. However I am seeing artifacting on the
> lossless animated images which is very concerning.

I think those may have been caused by the WAITING bug where it would "randomly" stop decoding midway through due to no network traffic.
Flags: needinfo?(aosmond)
This bug will probably help with some of the intermittents I was seeing on treeherder.
try with new gtests to exercise functionality that was broken:
Pushed by
Fix some WebP decoder implementation bugs. r=tnikkel
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Duplicate of this bug: 1504120
You need to log in before you can comment on or make changes to this bug.