jdk/src/share/native/sun/awt/image/gif/gifdecoder.c
changeset 2610 9856ea68e32b
parent 2 90ce3da70b43
child 5506 202f599c92aa
--- a/jdk/src/share/native/sun/awt/image/gif/gifdecoder.c	Tue Mar 03 16:10:37 2009 -0800
+++ b/jdk/src/share/native/sun/awt/image/gif/gifdecoder.c	Thu Mar 05 19:36:51 2009 +0300
@@ -191,6 +191,11 @@
     int passht = passinc;
     int len;
 
+    /* We have verified the initial code size on the java layer.
+     * Here we just check bounds for particular indexes. */
+    if (freeCode >= 4096 || maxCode >= 4096) {
+        return 0;
+    }
     if (blockh == 0 || raslineh == 0
         || prefixh == 0 || suffixh == 0
         || outCodeh == 0)