Bug 662230 - ArrayIndexOutOfBoundsException
Summary: ArrayIndexOutOfBoundsException
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.6.0-openjdk
Version: 13
Hardware: Unspecified
OS: Linux
Target Milestone: ---
Assignee: Denis Lila
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2010-12-10 22:50 UTC by Denis Lila
Modified: 2011-05-03 17:37 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-05-03 17:37:13 UTC
Type: ---

Attachments (Terms of Use)

Description Denis Lila 2010-12-10 22:50:11 UTC
Description of problem:
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 255
        at com.sun.imageio.plugins.png.PNGImageWriter.encodePass(PNGImageWriter.java:844)
        at com.sun.imageio.plugins.png.PNGImageWriter.write_IDAT(PNGImageWriter.java:944)
        at com.sun.imageio.plugins.png.PNGImageWriter.write(PNGImageWriter.java:1159)
        at javax.imageio.ImageWriter.write(ImageWriter.java:615)
        at javax.imageio.ImageIO.doWrite(ImageIO.java:1602)
        at javax.imageio.ImageIO.write(ImageIO.java:1526)
        at OrgChartVisualizer2.actionPerformed(OrgChartVisualizer2.java:3377)

Version-Release number of selected component (if applicable):

How reproducible:
run applet at http://saturnids.spicenet.net/sonario/develop081125/develop081125-mysql.html , go to org chart and try to save graph to file.
Actual results:
Exception is thrown and the image is not saved properly.

Expected results:
The image of a graph should be saved.

Comment 1 Denis Lila 2010-12-17 00:28:45 UTC
This is what I've found so far:

The bug happens because of indexed images are used, and has nothing
to do with the png encoders. What's happening is that, when the plugin
tries to draw some shapes to a buffered image that uses an indexed color
model. After some operations, one of the entries in image.raster.data
becomes -1, which is not a valid value because the particular color model
used supports indeces up to 27 only. This does not cause an
error as soon as it happens, but does so only when in encodePass, where
the colour index is used as an index into an array of length 28 and the
exception is thrown. So, the bug is in one of the rendering loops, not
in the png encoders. Unfortunately, the problematic loop (MaskFill)
is a native loop, which does not make debugging easy.

Comment 2 Deepak Bhole 2010-12-21 14:43:10 UTC
Bug should not be closed until the RPM is available in rawhide.

Comment 3 Denis Lila 2011-05-03 17:37:13 UTC
Fixed in head and 1.10 by this changeset:

Note You need to log in before you can comment on or make changes to this bug.