Piotr Karwasz created IMAGING-404:
-------------------------------------

             Summary: PSD parser throws IllegalArgumentException for a negative 
section length
                 Key: IMAGING-404
                 URL: https://issues.apache.org/jira/browse/IMAGING-404
             Project: Commons Imaging
          Issue Type: Bug
          Components: Format: PSD
    Affects Versions: 1.0.0-alpha6
            Reporter: Piotr Karwasz


{{PsdImageParser}} reads the color mode data, image resources and layer and 
mask information section lengths with {{BinaryFunctions.read4Bytes}} into a 
signed {{int}} and passes them to {{BinaryFunctions.skipBytes}}, without 
checking their sign. A length of {{0xFFFFFFFF}} is read as -1, and 
{{IOUtils.skip}} rejects it with {{IllegalArgumentException: Skip count must be 
non-negative, actual: -1}}, which escapes {{Imaging.getImageInfo}}, 
{{getBufferedImage}} and the other public methods instead of an 
{{ImagingException}}.

Suggested fix: reject negative section lengths with an {{ImagingException}} 
("Not a Valid PSD File").



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to