corrupt image neither shows error message nor fires load event

RESOLVED WORKSFORME

Status

()

RESOLVED WORKSFORME
11 years ago
7 years ago

People

(Reporter: Dolske, Unassigned)

Tracking

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
I wrote a basic reftest for the GIF crash in bug 413931, a simple line |load bug_413931.gif| in a reftest.list. This causes a reftest failure after a few seconds with "REFTEST UNEXPECTED FAIL (LOADING): file:///...." This is caused by the page's onload event not firing.

If you load the image directly in the browser, you just get a blank page. (And not the normal error text for corrupt images, as with the images in /modules/libpr0n/test/reftest/pngsuuite-corrupted/). Interestingly, if you load the image via a little HTML wrapper that sets the CSS background-color for the image, a rectangular region is visible.

In the console I get "WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file /Users/dolske/ff/trunk1/mozilla/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp, line 244"

 239 nsresult nsGIFDecoder2::ProcessData(unsigned char *data, PRUint32 count ...
 240 {
 241   // Push the data to the GIF decoder
 242   
 243   nsresult rv = GifWrite(data, count);
 244   NS_ENSURE_SUCCESS(rv, rv);

I think what's happening here is a result of the issue in bug 413595. Decoding errors are being lost, so I bet we're getting some kind of half-built (!) imgIContainer to display, but the early decoder failure never gets around to firing the load event.
Would this also prevent onload from firing on a webpage?
What kind of action is needed here?
Well, checking whether the bug is still present..  In particular, whether using that image fires either an error or a load event.
Created attachment 578728 [details]
testcase

Like this? I do get the onload callback called here. Does this mean that this bug is fixed?

Note that I first changed the MIME type of that image attachment,
https://bugzilla.mozilla.org/attachment.cgi?id=299702

from text/plain to image/gif.
Hmm.  That looks pretty good.  The initial bug was about whether loading https://bug413931.bugzilla.mozilla.org/attachment.cgi?id=299702 directly in the browser fires a load event on that browser.  That seems to be working too:

data:text/html,<iframe src="https://bug413931.bugzilla.mozilla.org/attachment.cgi?id=299702" onload="alert('Loaded')"></iframe>
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.