$OpenBSD: patch-j2se_src_share_native_sun_awt_image_gif_gifdecoder_c,v 1.2 2007/07/18 15:09:52 kurt Exp $
--- j2se/src/share/native/sun/awt/image/gif/gifdecoder.c.orig	Wed Sep 10 21:54:06 2003
+++ j2se/src/share/native/sun/awt/image/gif/gifdecoder.c	Wed Jul 18 10:56:32 2007
@@ -366,7 +366,7 @@ Java_sun_awt_image_GifImageDecoder_parseImage(JNIEnv *
 	 * been stacked LIFO, so deal with it that way...
 	 */
 	len = OUTCODELENGTH - outCount;
-	while (--len >= 0) {
+	while ((width > 0) && (--len >= 0)) {
 	    rasline[off++] = outCode[outCount++];
 
 	    /* Update the X-coordinate, and if it overflows, update the
