-
Bug
-
Resolution: Not an Issue
-
P2
-
None
-
1.2.0, 1.4.0
-
None
-
generic
-
generic, solaris_2.6
This bug came in from Germany:
Using BufferedImage.TYPE_INT_ARGB causes the same exception.
Changing the size of imgSize (the array dimension) from 262144 down to 10 causes the same exception.
Same happens on windows-NT (no further information was given).
The following program demonstrates the bug:
//---------------------------------------------------------------------
import java.util.*;
import java.awt.*;
import java.awt.image.*;
import java.awt.geom.*;
public class test {
public static void main(String argv[]) {
test t = new test();
t.setImg();
}
public void setImg() {
imgSize= iw*ih;
ar = new int[imgSize];
for (int i=0;i<imgSize;i++) ar[i]= 0xFF00AABB;
bi_in = new BufferedImage (iw,ih,
BufferedImage.TYPE_INT_RGB);
in_rs = bi_in.getRaster();
in_rs.setPixels(0,0,iw,ih,ar); // <---------------------------
}
private BufferedImage bi_in = null;
private WritableRaster in_rs = null;
int iw = 512;
int ih = 512;
int imgSize= 0;
int i;
int ar[];
}
//---------------------------------------------------------------------
tomboy% /net/mulder.eng/export/mulder3/jdk12x/sparc/jdk1.2FCS/bin/java -version
java version "1.2"
Classic VM (build JDK-1.2-V, green threads, sunwjit)
tomboy% /net/mulder.eng/export/mulder3/jdk12x/sparc/jdk1.2FCS/bin/javac test.java
tomboy% /net/mulder.eng/export/mulder3/jdk12x/sparc/jdk1.2FCS/bin/java test
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 262144
at java.awt.image.SinglePixelPackedSampleModel.setPixels(Compiled Code)
at java.awt.image.WritableRaster.setPixels(Compiled Code)
at test.setImg(Compiled Code)
at test.main(Compiled Code)
-----------
Thomas Meissner | Tel: +49-9131-84-8207
SHS GmbH & CoKG, PACS E | Fax: +49-9131-84-2040
Henkestr. 127 | Email:
###@###.###
D-91052 Erlangen (Germany)
Using BufferedImage.TYPE_INT_ARGB causes the same exception.
Changing the size of imgSize (the array dimension) from 262144 down to 10 causes the same exception.
Same happens on windows-NT (no further information was given).
The following program demonstrates the bug:
//---------------------------------------------------------------------
import java.util.*;
import java.awt.*;
import java.awt.image.*;
import java.awt.geom.*;
public class test {
public static void main(String argv[]) {
test t = new test();
t.setImg();
}
public void setImg() {
imgSize= iw*ih;
ar = new int[imgSize];
for (int i=0;i<imgSize;i++) ar[i]= 0xFF00AABB;
bi_in = new BufferedImage (iw,ih,
BufferedImage.TYPE_INT_RGB);
in_rs = bi_in.getRaster();
in_rs.setPixels(0,0,iw,ih,ar); // <---------------------------
}
private BufferedImage bi_in = null;
private WritableRaster in_rs = null;
int iw = 512;
int ih = 512;
int imgSize= 0;
int i;
int ar[];
}
//---------------------------------------------------------------------
tomboy% /net/mulder.eng/export/mulder3/jdk12x/sparc/jdk1.2FCS/bin/java -version
java version "1.2"
Classic VM (build JDK-1.2-V, green threads, sunwjit)
tomboy% /net/mulder.eng/export/mulder3/jdk12x/sparc/jdk1.2FCS/bin/javac test.java
tomboy% /net/mulder.eng/export/mulder3/jdk12x/sparc/jdk1.2FCS/bin/java test
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 262144
at java.awt.image.SinglePixelPackedSampleModel.setPixels(Compiled Code)
at java.awt.image.WritableRaster.setPixels(Compiled Code)
at test.setImg(Compiled Code)
at test.main(Compiled Code)
-----------
Thomas Meissner | Tel: +49-9131-84-8207
SHS GmbH & CoKG, PACS E | Fax: +49-9131-84-2040
Henkestr. 127 | Email:
###@###.###
D-91052 Erlangen (Germany)
- duplicates
-
JDK-4349991 Regression test java/awt/image/Bug4198296.java failing
-
- Closed
-
- relates to
-
JDK-4332331 Reg Test java/awt/image/Bug4198296.java fails
-
- Closed
-