< prev index next >

modules/javafx.graphics/src/main/java/com/sun/pisces/JavaSurface.java

Print this page
rev 10250 : imported patch 9-cpu-1701.patch

@@ -33,10 +33,14 @@
 
     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 >