You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dominik Stadler (Jira)" <ji...@apache.org> on 2022/05/21 17:34:00 UTC

[jira] [Created] (IMAGING-335) NullPointerException in App2Segment.getIccBytes when parsing a broken JPEG file

Dominik Stadler created IMAGING-335:
---------------------------------------

             Summary: NullPointerException in App2Segment.getIccBytes when parsing a broken JPEG file
                 Key: IMAGING-335
                 URL: https://issues.apache.org/jira/browse/IMAGING-335
             Project: Commons Imaging
          Issue Type: Bug
          Components: Format: JPEG
    Affects Versions: 1.0-alpha3
            Reporter: Dominik Stadler
         Attachments: NullPointer.jpg

The following snipped throws a NullPointerException:
{noformat}
Imaging.getICCProfile(FileUtils.readFileToByteArray(new File("NullPointer.jpg"))); {noformat}
 

Stacktrace:
{noformat}
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) {noformat}
 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)