$OpenBSD: patch-j2sdk1_3_1_src_share_native_sun_awt_image_gif_gifdecoder_c,v 1.2 2007/07/18 14:19:27 kurt Exp $
--- j2sdk1.3.1/src/share/native/sun/awt/image/gif/gifdecoder.c.orig	Sun May  6 08:22:09 2001
+++ j2sdk1.3.1/src/share/native/sun/awt/image/gif/gifdecoder.c	Wed Jul 18 09:36:14 2007
@@ -369,7 +369,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
