Blame SOURCES/libtiff-CVE-2013-4243.patch

460672
diff --git a/tools/gif2tiff.c b/tools/gif2tiff.c
460672
index 2731273..1e9b4b9 100644
460672
--- a/tools/gif2tiff.c
460672
+++ b/tools/gif2tiff.c
460672
@@ -280,6 +280,10 @@ readgifimage(char* mode)
460672
         fprintf(stderr, "no colormap present for image\n");
460672
         return (0);
460672
     }
460672
+    if (width == 0 || height == 0) {
460672
+        fprintf(stderr, "Invalid value of width or height\n");
460672
+        return(0);
460672
+    }
460672
     if ((raster = (unsigned char*) _TIFFmalloc(width*height+EXTRAFUDGE)) == NULL) {
460672
         fprintf(stderr, "not enough memory for image\n");
460672
         return (0);
460672
@@ -406,6 +410,10 @@ process(register int code, unsigned char** fill)
460672
             fprintf(stderr, "bad input: code=%d is larger than clear=%d\n",code, clear);
460672
             return 0;
460672
         }
460672
+        if (*fill >= raster + width*height) {
460672
+            fprintf(stderr, "raster full before eoi code\n");
460672
+            return 0;
460672
+        }
460672
 	*(*fill)++ = suffix[code];
460672
 	firstchar = oldcode = code;
460672
 	return 1;
460672
@@ -436,6 +444,10 @@ process(register int code, unsigned char** fill)
460672
     }
460672
     oldcode = incode;
460672
     do {
460672
+        if (*fill >= raster + width*height) {
460672
+            fprintf(stderr, "raster full before eoi code\n");
460672
+            return 0;
460672
+        }
460672
 	*(*fill)++ = *--stackp;
460672
     } while (stackp > stack);
460672
     return 1;