Alpha-channel code breaks on images >= 32768 pixels

VERIFIED DUPLICATE of bug 157202

Status

Core Graveyard
Image: Painting
--
major
VERIFIED DUPLICATE of bug 157202
17 years ago
8 years ago

People

(Reporter: jesup, Assigned: Stuart Parmenter)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
The image alpha-channel code appears to have serious problems if an image is
larger than 32767 pixels; my reading of the code is that it will attempt to
allocate a negative amount of memory, which is quite bad.  These should be
PRUint32's or PRUintn's.  Even a GIF can be 64K-1 pixels wide from my reading of
the GIF decoder, and other formats almost certainly can be wider.

This comment is taken from bug 98252:


My only quibble (which is a quibble to the original code, not the patch) is that
there's an assumption inherent in the Alpha code (and quite possibly in other
code as well) that a row is no more than 32K bytes long - and for 8-bit alpha,
that means 32K pixels wide (and no more than 32K pixels high):

   PRInt16       mAlphaRowBytes;     // alpha bytes per row
+  PRInt16       mTrueAlphaRowBytes; // alpha bytes per row
   PRInt16       mAlphaWidth;        // alpha layer width
   PRInt16       mAlphaHeight;       // alpha layer height
(Reporter)

Comment 1

17 years ago
We should address this if possible; this would probably cause either a crash or
at least mis-behavior in the face of a very large image (such as high-DPI scans,
NASA images, etc).  At minimum let's get this in the priority/schedule queue.
Keywords: mozilla0.9.7
(Assignee)

Updated

16 years ago
Target Milestone: --- → Future
Keywords: mozilla0.9.7
(Assignee)

Comment 2

16 years ago
Moving bugs to new Image: GFX component
Component: ImageLib → Image: GFX

Updated

16 years ago
Blocks: 157202
(Reporter)

Comment 3

16 years ago
Tor says this is fixed (X11 may choke but we won't)
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED

Comment 4

16 years ago
*** This bug has been marked as a duplicate of 157202 ***

*** This bug has been marked as a duplicate of 157202 ***
Resolution: FIXED → DUPLICATE

Comment 5

16 years ago
Verified Duplicate
Status: RESOLVED → VERIFIED

Updated

8 years ago
Component: Image: Painting → Image: Painting
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.