giflib/CVE-2019-15133.patch
2019-12-25 15:46:31 +08:00

12 lines
576 B
Diff

--- a/lib/dgif_lib.c 2019-10-15 07:16:42.457000000 -0400
+++ b/lib/dgif_lib-1.c 2019-10-15 07:18:08.173000000 -0400
@@ -1103,7 +1103,7 @@ DGifSlurp(GifFileType *GifFile)
sp = &GifFile->SavedImages[GifFile->ImageCount - 1];
/* Allocate memory for the image */
- if (sp->ImageDesc.Width < 0 && sp->ImageDesc.Height < 0 &&
+ if (sp->ImageDesc.Width <= 0 && sp->ImageDesc.Height <= 0 &&
sp->ImageDesc.Width > (INT_MAX / sp->ImageDesc.Height)) {
return GIF_ERROR;
}