Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
On some files, GifDecoder throws ArrayIndexOutOfBoundsException. Here's the reproducer:
import javax.swing.JFrame;
import javax.swing.JEditorPane;
public class Test {
public static void main(String argv[]) {
try
catch (Throwable e)
{ e.printStackTrace(System.out); } }
}
Output on Harmony/IBM VME:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(System.java:327)
at java.lang.System.arraycopy(System.java:237)
at org.apache.harmony.awt.gl.image.OffscreenImage.setPixels(OffscreenImage.java:286)
at org.apache.harmony.awt.gl.image.ImageDecoder.setPixels(ImageDecoder.java:180)
at org.apache.harmony.awt.gl.image.GifDecoder$GifGraphicBlock.sendNewData(GifDecoder.java:446)
at org.apache.harmony.awt.gl.image.GifDecoder.decodeImage(GifDecoder.java:221)
at org.apache.harmony.awt.gl.image.DecodingImageSource.load(DecodingImageSource.java:252)
at org.apache.harmony.awt.gl.image.ImageLoader.run(ImageLoader.java:153)
Also, the exception causes an image placeholder to be displayed instead of the image (see attached screenshots).
On DRLVM (both Jit and Interpreter), the same test crashes instead of throwing exception (see attached screenshot, clicking Retry - Debug doesn't provide any detail). As the crash occurs in exactly the same local situation, I suppose the problem is not in DRLVM but in classlib indeed. If investigation proves otherwise - a separate issue would have to be filed.
The test file triggering the bug is triangle-rt.gif file from Abbot package (http://abbot.sourceforge.net). This file is attached here purely for purpose of reproducing and localizing the bug, and as Abbot is CPL, I suppose this file must not be included into Harmony in any form.
The problem was discovered while trying to run Abbot Costello on Harmony.