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.
Actually, I've just noticed that ImageDecoder::isOverSize does check that area is below 2^29. Changing the bug status to INVALID.