For some image files of type PNG, when they are converted to BufferedImage.TYPE_INT_ARGB, a java.lang.ArrayIndexOutOfBoundsException exception is thrown.
This bug was introduced with Java2D PIT "Build:08-Nov-02@02:50.mantis". The failure does not occur with last promoted Mantis build 1.4.2-beta-b06.
The bug occurs on Solaris and Win2000 platforms. The failure has (so far) not been reproducable with JPG image files.
A test application "BufferedImageTest.java" is attached to reproduce the failure. The application will read an image file and then go through converting the image to all supported BufferedImage types. See sample output below.
Steps to reproduce:
------------------
java BufferedImageTest <file name, otherwise defaults to shade.png>
1) java BufferedImageTest cup.png
Testing with image: cup.png (test passes with this PNG file)
2) java BufferedImageTest shade.png
Testing with image: shade.png
Fail with BufferedImage Type: BufferedImage.TYPE_INT_ARGB java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
at sun.awt.image.ShortInterleavedRaster.getDataElements(ShortInterleavedRaster.java:221)
at sun.java2d.loops.OpaqueCopyAnyToArgb.Blit(CustomComponent.java:104)
at sun.java2d.pipe.DrawImage.blitSurfaceData(DrawImage.java:621)
at sun.java2d.pipe.DrawImage.renderSurfaceData(DrawImage.java:346)
at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:66)
at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:50)
at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:717)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2755)
at sun.awt.image.ImageRepresentation.drawToBufImage(ImageRepresentation.java:726)
at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:724)
at sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:147)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2755)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2745)
at BufferedImageTest.test(BufferedImageTest.java:61)
at BufferedImageTest.main(BufferedImageTest.java:77)