ImageIO PNG error on java 11

Seán Coffey sean.coffey at oracle.com
Fri Oct 12 09:54:36 UTC 2018


Thanks for the report. I see you've already reported this issue via 
https://bugreport.java.com/bugreport/

Now tracked via https://bugs.openjdk.java.net/browse/JDK-8212116

You can continue the conversation via 2d-dev mailing list, if necessary.

Regards,
Sean.

On 12/10/18 10:33, Jan Vomlel wrote:
> When I try to read some png files, I get exception:
>
>     at 
> java.desktop/com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:891)
>     at 
> java.desktop/com.sun.imageio.plugins.png.PNGImageReader.getImageMetadata(PNGImageReader.java:1799)
>     Caused by: javax.imageio.IIOException: tEXt chunk length is not 
> proper
>     at 
> java.desktop/com.sun.imageio.plugins.png.PNGImageReader.parse_tEXt_chunk(PNGImageReader.java:575)
>     at 
> java.desktop/com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:847)
>     .. 28 more||
>
> I think there are errors in file PNGImageReader. For example on line 574:
>     if (textLength <= 0) {
>         throw new IIOException("tEXt chunk length is not proper");
>     }
>
> Right condition is:
>     if (textLength < 0) {
>         throw new IIOException("tEXt chunk length is not proper");
>     }
> Similar problem is on a few other lines.
>
> It was caused by commit:
> http://hg.openjdk.java.net/jdk/jdk/rev/fb62f481671e
>
> On java 10 it is working.
>
> Bug can be tested on the image:
> https://user-images.githubusercontent.com/12710508/46531012-fc1c4f80-c89b-11e8-91ec-65a81ae63f0f.png 
>
>
>
> <https://user-images.githubusercontent.com/12710508/46531012-fc1c4f80-c89b-11e8-91ec-65a81ae63f0f.png> 
>
>
>
> <https://user-images.githubusercontent.com/12710508/46531012-fc1c4f80-c89b-11e8-91ec-65a81ae63f0f.png> 
>
>
>
> <https://user-images.githubusercontent.com/12710508/46531012-fc1c4f80-c89b-11e8-91ec-65a81ae63f0f.png> 
>
>



More information about the jdk-dev mailing list