giflib/giflib-CVE-2016-3977.patch

16 lines
555 B
Diff

--- giflib-5.1.4/util/gif2rgb.c 2016-03-17 17:24:17.000000000 +0100
+++ giflib-5.1.4/util/gif2rgb.c 2016-04-12 10:37:35.672174495 +0200
@@ -471,6 +471,12 @@
exit(EXIT_FAILURE);
}
+ /* check that the background color isn't garbage (SF bug #87) */
+ if (GifFile->SBackGroundColor < 0 || GifFile->SBackGroundColor >= ColorMap->ColorCount) {
+ fprintf(stderr, "Background color out of range for colormap\n");
+ exit(EXIT_FAILURE);
+ }
+
DumpScreen2RGB(OutFileName, OneFileFlag,
ColorMap,
ScreenBuffer,