-
Bug
-
Resolution: Duplicate
-
P3
-
1.4.0, 5.0, 6u23, 6u38, 7, 7u40, 8
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2197065 | 7 | Andrew Brygin | P4 | Closed | Won't Fix |
I am using a JPEG ImageReader to read a jpeg image from a file. I have added an IIOReadProgressListener and an IIOReadUpdateListener to this ImageReader. When I tried to call reset() inside one of the listener's methods such as imageProgress(), imageUpdate(), passStarted(), passComplete() etc, the VM crashes. Same behavior is noticed even when dispose() or setInput() is called inside one of the listener's methods. This is reproducible with JPG reader alone on Solaris as well as Win32 platforms right from JDK1.4+.
Calling reset() / setInput() inside the imageProgress() method throws NullPointerException for GIF and PNG readers. Calling dispose() inside the same method does not have any effect for these ImageReaders.
I have attached 2 sample codes. ImageReaderTest.java can be executed to reproduce the VM crash and ImageReaderTest2.java can be executed to reproduce the NullPointerException. I tested this on WinXP and Solaris 8.
Here is the exception:
java.lang.NullPointerException
at com.sun.imageio.plugins.png.PNGImageReader.decodePass(PNGImageReader.java:1165)
at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(PNGImageReader.java:1287)
at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1362)
at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1530)
at javax.imageio.ImageReader.read(ImageReader.java:919)
at ImageReaderTest2.<init>(ImageReaderTest2.java:31)
at ImageReaderTest2.main(ImageReaderTest2.java:39)
I have also attached the log file created at the time of VM crash.
Calling reset() / setInput() inside the imageProgress() method throws NullPointerException for GIF and PNG readers. Calling dispose() inside the same method does not have any effect for these ImageReaders.
I have attached 2 sample codes. ImageReaderTest.java can be executed to reproduce the VM crash and ImageReaderTest2.java can be executed to reproduce the NullPointerException. I tested this on WinXP and Solaris 8.
Here is the exception:
java.lang.NullPointerException
at com.sun.imageio.plugins.png.PNGImageReader.decodePass(PNGImageReader.java:1165)
at com.sun.imageio.plugins.png.PNGImageReader.decodeImage(PNGImageReader.java:1287)
at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1362)
at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1530)
at javax.imageio.ImageReader.read(ImageReader.java:919)
at ImageReaderTest2.<init>(ImageReaderTest2.java:31)
at ImageReaderTest2.main(ImageReaderTest2.java:39)
I have also attached the log file created at the time of VM crash.
- backported by
-
JDK-2197065 Calling Reader.reset() inside the listener methods causes VM Crash
-
- Closed
-
- relates to
-
JDK-5096514 Hotspot error log generated while running ImageIO test
-
- Closed
-
-
JDK-4874501 VM crashes when writer.dispose() is called within imageProgress() method
-
- Closed
-