Uploaded image for project: 'Commons Imaging'
  1. Commons Imaging
  2. IMAGING-334

ArrayIndexOutOfBoundsException in IcnsDecoder when parsing a broken ICNS file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.0-alpha3
    • None
    • Format: ICNS

    Description

      The following snipped throws an ArrayIndexOutOfBoundsException:

      Imaging.getAllBufferedImages(FileUtils.readFileToByteArray(new File("ArrayIndexOutOfBoundsException.icon"))); 

       

      Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 65539 out of bounds for length 65536
          at org.apache.commons.imaging.formats.icns.Rle24Compression.decompress(Rle24Compression.java:51)
          at org.apache.commons.imaging.formats.icns.IcnsDecoder.decodeImageImpl(IcnsDecoder.java:254)
          at org.apache.commons.imaging.formats.icns.IcnsDecoder.decodeImage(IcnsDecoder.java:241)
          at org.apache.commons.imaging.formats.icns.IcnsDecoder.decodeAllImages(IcnsDecoder.java:197)
          at org.apache.commons.imaging.formats.icns.IcnsImageParser.getAllBufferedImages(IcnsImageParser.java:246)
          at org.apache.commons.imaging.Imaging.getAllBufferedImages(Imaging.java:758)
          at org.apache.commons.imaging.Imaging.getAllBufferedImages(Imaging.java:741) 

      Attachments

        1. ArrayIndexOutOfBoundsException.icon
          197 kB
          Dominik Stadler

        Activity

          People

            Unassigned Unassigned
            dominik.stadler@gmx.at Dominik Stadler
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: