You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.4 KiB
43 lines
1.4 KiB
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); |
|
} |
|
}
|
|
|