< prev index next >
modules/graphics/src/main/java/com/sun/pisces/JavaSurface.java
Print this page
rev 9617 : imported patch 8u121.patch
*** 33,42 ****
--- 33,46 ----
private int[] dataInt;
public JavaSurface(int[] dataInt, int dataType, int width, int height) {
super(width, height);
+ if (dataInt.length / width < height) {
+ throw new IllegalArgumentException("width(=" + width + ") * height(="
+ + height + ") is greater than dataInt.length(=" + dataInt.length + ")");
+ }
this.dataInt = dataInt;
this.dataBuffer = IntBuffer.wrap(this.dataInt);
initialize(dataType, width, height);
}
< prev index next >