$OpenBSD: patch-j2sdk1_3_1_src_share_native_sun_awt_image_gif_gifdecoder_c,v 1.1 2007/01/28 04:46:48 kurt Exp $
--- j2sdk1.3.1/src/share/native/sun/awt/image/gif/gifdecoder.c.orig	Sat Jan 27 17:17:07 2007
+++ j2sdk1.3.1/src/share/native/sun/awt/image/gif/gifdecoder.c	Sat Jan 27 17:17:44 2007
@@ -369,7 +369,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
