diff options
Diffstat (limited to 'giflib_coverity.patch')
-rw-r--r-- | giflib_coverity.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/giflib_coverity.patch b/giflib_coverity.patch new file mode 100644 index 0000000..c51234f --- /dev/null +++ b/giflib_coverity.patch @@ -0,0 +1,43 @@ +diff -rupN --no-dereference giflib-5.2.1/gif2rgb.c giflib-5.2.1-new/gif2rgb.c +--- giflib-5.2.1/gif2rgb.c 2019-06-24 09:24:27.000000000 +0200 ++++ giflib-5.2.1-new/gif2rgb.c 2020-02-17 16:51:04.468397502 +0100 +@@ -170,6 +170,8 @@ static void SaveGif(GifByteType *OutputB + /* Open stdout for the output file: */ + if ((GifFile = EGifOpenFileHandle(1, &Error)) == NULL) { + PrintGifError(Error); ++ free(OutputBuffer); ++ GifFreeMapObject(OutputColorMap); + exit(EXIT_FAILURE); + } + +@@ -179,6 +181,8 @@ static void SaveGif(GifByteType *OutputB + EGifPutImageDesc(GifFile, + 0, 0, Width, Height, false, NULL) == GIF_ERROR) { + PrintGifError(Error); ++ free(OutputBuffer); ++ GifFreeMapObject(OutputColorMap); + exit(EXIT_FAILURE); + } + +@@ -187,8 +191,11 @@ static void SaveGif(GifByteType *OutputB + GifFile->Image.Width, GifFile->Image.Height); + + for (i = 0; i < Height; i++) { +- if (EGifPutLine(GifFile, Ptr, Width) == GIF_ERROR) ++ if (EGifPutLine(GifFile, Ptr, Width) == GIF_ERROR) { ++ free(OutputBuffer); ++ GifFreeMapObject(OutputColorMap); + exit(EXIT_FAILURE); ++ } + GifQprintf("\b\b\b\b%-4d", Height - i - 1); + + Ptr += Width; +@@ -196,6 +203,8 @@ static void SaveGif(GifByteType *OutputB + + if (EGifCloseFile(GifFile, &Error) == GIF_ERROR) { + PrintGifError(Error); ++ free(OutputBuffer); ++ GifFreeMapObject(OutputColorMap); + exit(EXIT_FAILURE); + } + } |