Bug 662230

Summary: ArrayIndexOutOfBoundsException
Product: [Fedora] Fedora Reporter: Denis Lila <dlila>
Component: java-1.6.0-openjdkAssignee: Denis Lila <dlila>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: ahughes, dbhole, don-redhat-z6y, jvanek, langel, lkundrak, mjw, mmatejov, omajid
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-03 13:37:13 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Denis Lila 2010-12-10 17:50:11 EST
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-16 19:28:45 EST
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 09:43:10 EST
Bug should not be closed until the RPM is available in rawhide.
Comment 3 Denis Lila 2011-05-03 13:37:13 EDT
Fixed in head and 1.10 by this changeset: