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.
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.
Bug should not be closed until the RPM is available in rawhide.
Fixed in head and 1.10 by this changeset: http://icedtea.classpath.org/hg/release/icedtea6-1.10/rev/ae5814009b4e