$OpenBSD: patch-j2se_src_share_native_sun_awt_image_gif_gifdecoder_c,v 1.1 2007/01/28 04:45:04 kurt Exp $
--- j2se/src/share/native/sun/awt/image/gif/gifdecoder.c.orig	Sat Jan 27 17:11:30 2007
+++ j2se/src/share/native/sun/awt/image/gif/gifdecoder.c	Sat Jan 27 17:12:02 2007
@@ -366,7 +366,7 @@ Java_sun_awt_image_GifImageDecoder_parse
 	 * 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
