6736178: java.awt.image.SampleModel constructor unexpectedly throws IllegalArgumentException
authorbae
Mon, 20 Dec 2010 10:38:55 +0300
changeset 7749 e14a1aba2e10
parent 7748 26e6f5fc1bdb
child 7750 cb72c76bfec8
6736178: java.awt.image.SampleModel constructor unexpectedly throws IllegalArgumentException Reviewed-by: jgodinez, prr
jdk/src/share/classes/java/awt/image/SampleModel.java
--- a/jdk/src/share/classes/java/awt/image/SampleModel.java	Fri Dec 17 09:39:54 2010 -0800
+++ b/jdk/src/share/classes/java/awt/image/SampleModel.java	Mon Dec 20 10:38:55 2010 +0300
@@ -121,7 +121,7 @@
      */
     public SampleModel(int dataType, int w, int h, int numBands)
     {
-        float size = (float)w*h;
+        long size = (long)w * h;
         if (w <= 0 || h <= 0) {
             throw new IllegalArgumentException("Width ("+w+") and height ("+
                                                h+") must be > 0");