7018912: [parfait] potential buffer overruns in imageio jpeg
authorbae
Thu, 17 Feb 2011 13:42:26 +0300
changeset 8358 39c22ace748d
parent 8357 7da1b1af2da0
child 8359 b2e3eb2cc841
7018912: [parfait] potential buffer overruns in imageio jpeg Reviewed-by: jgodinez, prr
jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c
--- a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	Wed Feb 16 15:58:28 2011 -0800
+++ b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	Thu Feb 17 13:42:26 2011 +0300
@@ -1846,7 +1846,7 @@
 
     cinfo = (j_decompress_ptr) data->jpegObj;
 
-    if ((numBands < 1) ||
+    if ((numBands < 1) || (numBands > MAX_BANDS) ||
         (sourceXStart < 0) || (sourceXStart >= (jint)cinfo->image_width) ||
         (sourceYStart < 0) || (sourceYStart >= (jint)cinfo->image_height) ||
         (sourceWidth < 1) || (sourceWidth > (jint)cinfo->image_width) ||