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

NullPointerException in App2Segment.getIccBytes when parsing a broken JPEG file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-alpha3
    • None
    • Format: JPEG
    • None

    Description

      The following snipped throws a NullPointerException:

      Imaging.getICCProfile(FileUtils.readFileToByteArray(new File("NullPointer.jpg"))); 

       

      Stacktrace:

      Exception in thread "main" java.lang.NullPointerException
          at org.apache.commons.imaging.formats.jpeg.segments.App2Segment.getIccBytes(App2Segment.java:90)
          at org.apache.commons.imaging.formats.jpeg.JpegImageParser.getICCProfileBytes(JpegImageParser.java:294)
          at org.apache.commons.imaging.formats.jpeg.JpegImageParser.getICCProfileBytes(JpegImageParser.java:65)
          at org.apache.commons.imaging.Imaging.getICCProfileBytes(Imaging.java:404)
          at org.apache.commons.imaging.Imaging.getICCProfile(Imaging.java:347)
          at org.apache.commons.imaging.Imaging.getICCProfile(Imaging.java:318) 

       

      Attachments

        1. NullPointer.jpg
          112 kB
          Dominik Stadler

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: