commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug McLaren (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IMAGING-107) sanselan throws a java.lang.NegativeArraySizeException on at least this one .jpg file
Date Mon, 03 Jun 2013 21:00:20 GMT
Doug McLaren created IMAGING-107:
------------------------------------

             Summary: sanselan throws a java.lang.NegativeArraySizeException on at least this
one .jpg file
                 Key: IMAGING-107
                 URL: https://issues.apache.org/jira/browse/IMAGING-107
             Project: Commons Imaging
          Issue Type: Bug
          Components: Format: JPEG
    Affects Versions: 0.97
         Environment: Linux, Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
(though I doubt that matters.)
            Reporter: Doug McLaren
            Priority: Minor
         Attachments: pod_tile_foundation.jpg

Saneslan seems unable to run getImageInfo() on the attached file, gives this error --

java.lang.NegativeArraySizeException
        at org.apache.sanselan.common.BinaryFileFunctions.readByteArray(BinaryFileFunctions.java:496)
        at org.apache.sanselan.formats.jpeg.JpegUtils.traverseJFIF(JpegUtils.java:94)
        at org.apache.sanselan.formats.jpeg.JpegImageParser.readSegments(JpegImageParser.java:170)
        at org.apache.sanselan.formats.jpeg.JpegImageParser.readSegments(JpegImageParser.java:267)
        at org.apache.sanselan.formats.jpeg.JpegImageParser.getImageInfo(JpegImageParser.java:659)
        at org.apache.sanselan.Sanselan.getImageInfo(Sanselan.java:589)
        at org.apache.sanselan.Sanselan.getImageInfo(Sanselan.java:563)
        at org.apache.sanselan.Sanselan.getImageInfo(Sanselan.java:582)
        at SanselanTest.main(SanselanTest.java:68)

Now, this error seems very similar to IMAGING-21, but it's not quite the same for two reasons
--

1) the stack is somewhat different, and
2) the fix provided for that bug does not fix this issue.

Now, looking at the file that triggers this issue, other tools throw a warning for it --

gimp says: Corrupt JPEG data: 2715 extraneous bytes before marker 0xe2
xv says the same thing.
convert from ImageMagick converts it with no error or warning.
jhead says: Nonfatal Error : 'pod_tile_foundation.jpg' Extraneous 2715 padding bytes before
section E2
jpegtran says: Corrupt JPEG data: 2715 extraneous bytes before marker 0xe2

... so it seems there's something actually wrong with this file, but even so, the image is
there, and other tools can determine the dimensions of it, so in theory sanselan ought to
be able to as well.

I'll include the somewhat corrupt file that is triggering this exception, as well as the test
case program (which came straight from IMAGING-21.)

The test case also checks the two files that were included in IMAGING-21 just to show that
that problem was fixed (at least once I applied the fix included there.)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message