jdk/src/share/classes/sun/awt/image/IntegerComponentRaster.java
changeset 18246 5d1d50a81438
parent 18225 35a86d260c7b
child 22584 eed64ee05369
--- a/jdk/src/share/classes/sun/awt/image/IntegerComponentRaster.java	Tue Apr 23 11:13:38 2013 +0100
+++ b/jdk/src/share/classes/sun/awt/image/IntegerComponentRaster.java	Wed Apr 24 21:15:54 2013 +0400
@@ -656,7 +656,8 @@
 
         // we can be sure that width and height are greater than 0
         if (scanlineStride < 0 ||
-            scanlineStride > (Integer.MAX_VALUE / height))
+            scanlineStride > (Integer.MAX_VALUE / height) ||
+            scanlineStride > data.length)
         {
             // integer overflow
             throw new RasterFormatException("Incorrect scanline stride: "
@@ -665,7 +666,8 @@
         int lastScanOffset = (height - 1) * scanlineStride;
 
         if (pixelStride < 0 ||
-            pixelStride > (Integer.MAX_VALUE / width))
+            pixelStride > (Integer.MAX_VALUE / width) ||
+            pixelStride > data.length)
         {
             // integer overflow
             throw new RasterFormatException("Incorrect pixel stride: "