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

GIF reader throws misleading exception with truncated images

XMLWordPrintable

    • b16
    • generic
    • generic

        GIF image reader throws misleading exception if image in question is truncated:

        java.lang.IndexOutOfBoundsException: off < 0 || len < 0 || off+len > b.length || off+len < 0!
                at javax.imageio.stream.FileCacheImageInputStream.read(FileCacheImageInputStream.java:151)
                at com.sun.imageio.plugins.gif.GIFImageReader.getCode(GIFImageReader.java:306)
                at com.sun.imageio.plugins.gif.GIFImageReader.read(GIFImageReader.java:881)
                at javax.imageio.ImageIO.read(ImageIO.java:1422)
                at javax.imageio.ImageIO.read(ImageIO.java:1326)
                at imagedemo.Main.main(Main.java:23)

        Also the problem is the same in 1.5.0_07 and in 6.0u1-b03.

        Examples to truncated images are attached.

              jdv Jayathirth D V
              bae Andrew Brygin
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: