Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8211422

Reading PNG with corrupt CRC for IEND chunk throws IIOException

    Details

    • Subcomponent:
    • Introduced In Version:
      10
    • Resolved In Build:
      b23
    • CPU:
      generic
    • OS:
      generic

      Description

      A DESCRIPTION OF THE PROBLEM :
      Works ok in Java 8, fails in 10 and later

              FileImageInputStream imgStream = new FileImageInputStream(
                      new File("13.png"));
              Iterator iter = ImageIO.getImageReaders(imgStream);
              while (iter.hasNext()) {
                  ImageReader reader = (ImageReader) iter.next();
                  System.out.println(reader.getClass().getName());
                  reader.setInput(imgStream, false, false);
                  BufferedImage image = reader.read(0, reader.getDefaultReadParam());
                  System.out.println(reader);
      }

      Exception in thread "main" javax.imageio.IIOException: Error reading PNG metadata
      at java.desktop/com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:891)
      at java.desktop/com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1395)
      at java.desktop/com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1810)
      at ImageIOTest3.main(ImageIOTest3.java:33)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      at com.intellij.rt.execution.application.AppMainV2.main(AppMainV2.java:131)
      Caused by: javax.imageio.IIOException: Invalid chunk length 0
      at java.desktop/com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:765)
      ... 8 more

      Process finished with exit code 1


      REGRESSION : Last worked in version 10.0.1


      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jdv Jayathirth D V
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: