changeset 3269:0125062d65b6

6736178: java.awt.image.SampleModel constructor unexpectedly throws IllegalArgumentException Reviewed-by: jgodinez, prr
author bae
date Mon, 20 Dec 2010 10:38:55 +0300
parents 33a0f66771d5
children b0f9760f3103
files src/share/classes/java/awt/image/SampleModel.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/awt/image/SampleModel.java	Fri Dec 17 09:39:54 2010 -0800
+++ b/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");