-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b54
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2204912 | OpenJDK6 | Andrew Brygin | P4 | Resolved | Fixed | b21 |
The loop that reads null terminated strings just looks for 0 being
returned from ImageInputStream.read(). This ignores the possible value
of -1 which would indicate an end of stream. Because of this, truncated
PNG files could lead to long execution time (while the loop iterates at
the end of the stream) followed by an OutOfMemoryError (when enough -1
values have ben "read" and buffered).
Test demonstrates this problem is attached.
returned from ImageInputStream.read(). This ignores the possible value
of -1 which would indicate an end of stream. Because of this, truncated
PNG files could lead to long execution time (while the loop iterates at
the end of the stream) followed by an OutOfMemoryError (when enough -1
values have ben "read" and buffered).
Test demonstrates this problem is attached.
- backported by
-
JDK-2204912 PNG: reading metadata may cause OOM on truncated images.
-
- Resolved
-
- duplicates
-
JDK-4986776 com.sun.imageio.plugins.png.PNGImageWriter.deflate() is inefficient.
-
- Closed
-