Closed Bug 327074 Opened 18 years ago Closed 2 years ago

An 8BPP RLE encoded BMP with a row containing too many pixels fails to open/decompress

Categories

(Core :: Graphics: ImageLib, defect, P3)

defect

Tracking

()

RESOLVED FIXED
107 Branch
Tracking Status
firefox107 --- fixed

People

(Reporter: andy55, Assigned: emk)

References

()

Details

Attachments

(4 files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8
Build Identifier: 1.5.0.1

A particular 8-bit BMP image fails to open/decompress in Firefox (all platforms), while the same BMP file decompresses without error in Safari/QuickTime, Win32's LoadImage(), IE's image decompressor, GraphicConverter, Photoshop, irfanview, Mac OS X's Preview, and Windows XP Paint.  I've posted the image (and a html page that references it):

http://www.55ware.com/firefox_bug.html


Reproducible: Always

Steps to Reproduce:
1. Go to http://www.55ware.com/firefox_bug.html or open the said BMP in Firefox.
Actual Results:  
Firefox says image file "has errors" (or nothing at all when the BMP is in a html page).

Expected Results:  
Image loads fine in every other browser and image viewer but Firefox.
I confirm that this image opens in another image program (gqview) without errors, but that firefox will not render it.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Component: General → ImageLib
Product: Firefox → Core
Version: unspecified → 1.8 Branch
Version: 1.8 Branch → Trunk
Also see bug 327270 (png) & bug 326997 (jpg), which have both also been filed recently.
Assignee: nobody → pavlov
QA Contact: general
Assignee: pavlov → nobody
QA Contact: imagelib
Confirmed, this is still a problem. I can open the image correctly using external programs but not using Chrome+Safari on OS X.

From the error console:
Error: Image corrupt or truncated: https://bugzilla.mozilla.org/attachment.cgi?id=211801
Source File: https://bugzilla.mozilla.org/attachment.cgi?id=211801
Line: 0
Assignee: nobody → netzen
Status: NEW → ASSIGNED
A couple years(!) after I reported bug 327074, we made a compatibility alteration to our 8-bit BMP RLE compressor that resolved the issue.  It is highly likely that this fix applied on the decompression side in the mozilla codebase will fix issue 327074. 

The reason this issue exists in the mozilla codebase (and not on all other image decompressors) is that the mozilla BMP RLE8 decompressor probably assumes all run lengths are word aligned, but many RLE8 compressors don't adhere to this.  The mozilla RLE8 decompressor can trivially support this, so I've included the source code for ours for reference (see enclosed file BMP_RLE8.c).  Comparing DecodeBMP_RLE8() with mozilla's counterpart decompressor should quickly reveal where the mozilla implementation is going wrong.

I've also included our BMP RLE8 compressor (EncodeBMP_RLE8()), both before and after this word alignment compatibility alteration for reference.  Use diff on the command line with the two enclosed cpp files to easily see the changes we made for word alignment compatibility.  Of course although images we create are no contain this compatibility fix, the mozilla decompressor should be altered in order to address this image compatibility issue.

Andy O'Meara
SoundSpectrum
Thanks Andy, that sounds like it'll be a great help.
Summary: A particular 8-bit BMP fails to open/decompress → An 8BPP RLE encoded BMP with a row containing too many pixels fails to open/decompress
Assignee: netzen → nobody
No assignee, updating the status.
Status: ASSIGNED → NEW
No assignee, updating the status.
QA Whiteboard: qa-not-actionable

Comfirming this bug with Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0

As there seems to be a patch (comment 6)? What is the status of it?

In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.

Severity: major → --
Severity: -- → S3
Priority: -- → P3
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Pushed by VYV03354@nifty.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/6dadde336fc6
Allow RLE bitmaps with extra pixels per row to render. r=tnikkel
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: