changeset 3702:e45f7d50dbc9

7018912: [parfait] potential buffer overruns in imageio jpeg Reviewed-by: jgodinez, prr
author bae
date Thu, 17 Feb 2011 13:42:26 +0300
parents b04dafeda706
children 810445ab3099
files src/share/native/sun/awt/image/jpeg/imageioJPEG.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/native/sun/awt/image/jpeg/imageioJPEG.c	Wed Feb 16 15:58:28 2011 -0800
+++ b/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) ||