Bug 50779 - Large PNG images need a more robust size check
Summary: Large PNG images need a more robust size check
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-09 12:29 PST by Cosmin Truta
Modified: 2010-12-09 13:22 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cosmin Truta 2010-12-09 12:29:42 PST
Currently, PNG images of size 1000001x1 (1 megapixel, single-row or single-column) are rejected, while images of size 999999x999999 (ginormous, a little below 1 terapixel) are accepted by PNGImageDecoder. And yet, the difference in memory requirements between the two images is huge.
I propose the following limits:
image length: 2^20 - 1
image area: 2^29 - 1
The rationale for the image area limit is that RGBA images at 8 bits per channel should occupy no more than 2^31 bytes.

I wouldn't even mind if the image length restrictions were lifted, and all that's required were the 2^29 limit for the image area.
Comment 1 Cosmin Truta 2010-12-09 13:22:57 PST
Actually, I've just noticed that ImageDecoder::isOverSize does check that area is below 2^29.
Changing the bug status to INVALID.