|
@@ -1,4 +1,4 @@
|
|
|
-From a1c48b91cd1cf1e9bf7077709b69f4bfd4c4abc7 Mon Sep 17 00:00:00 2001
|
|
|
+From 7c3bce4add77944e5b479ef5da81ae7fd71a7e95 Mon Sep 17 00:00:00 2001
|
|
|
From: Sandro Mani <manisandro@gmail.com>
|
|
|
Date: Tue, 5 Dec 2023 16:38:48 -0700
|
|
|
Subject: [PATCH] Fix several defects found by Coverity scan
|
|
@@ -10,15 +10,17 @@ Signed-off-by: Sandro Mani <manisandro@gmail.com>
|
|
|
Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
|
|
|
[Fabrice: updated for 5.2.2]
|
|
|
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
|
+[Dario: make the patch to be applied with fuzz factor 0]
|
|
|
+Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
|
|
|
---
|
|
|
- gif2rgb.c | 11 ++++++++++-
|
|
|
- 1 file changed, 10 insertions(+), 1 deletion(-)
|
|
|
+ gif2rgb.c | 8 ++++++++
|
|
|
+ 1 file changed, 8 insertions(+)
|
|
|
|
|
|
diff --git a/gif2rgb.c b/gif2rgb.c
|
|
|
-index d9a469f..02cea41 100644
|
|
|
+index d51226d65d3d..50c43ae44ee2 100644
|
|
|
--- a/gif2rgb.c
|
|
|
+++ b/gif2rgb.c
|
|
|
-@@ -170,6 +170,8 @@ static void SaveGif(GifByteType *OutputBuffer,
|
|
|
+@@ -165,6 +165,8 @@ static void SaveGif(GifByteType *OutputBuffer, int Width, int Height,
|
|
|
/* Open stdout for the output file: */
|
|
|
if ((GifFile = EGifOpenFileHandle(1, &Error)) == NULL) {
|
|
|
PrintGifError(Error);
|
|
@@ -27,8 +29,8 @@ index d9a469f..02cea41 100644
|
|
|
exit(EXIT_FAILURE);
|
|
|
}
|
|
|
|
|
|
-@@ -179,6 +181,8 @@ static void SaveGif(GifByteType *OutputBuffer,
|
|
|
- EGifPutImageDesc(GifFile, 0, 0, Width, Height, false, NULL) ==
|
|
|
+@@ -173,6 +175,8 @@ static void SaveGif(GifByteType *OutputBuffer, int Width, int Height,
|
|
|
+ EGifPutImageDesc(GifFile, 0, 0, Width, Height, false, NULL) ==
|
|
|
GIF_ERROR) {
|
|
|
PrintGifError(Error);
|
|
|
+ free(OutputBuffer);
|
|
@@ -36,7 +38,7 @@ index d9a469f..02cea41 100644
|
|
|
exit(EXIT_FAILURE);
|
|
|
}
|
|
|
|
|
|
-@@ -187,6 +191,8 @@ static void SaveGif(GifByteType *OutputBuffer,
|
|
|
+@@ -182,6 +186,8 @@ static void SaveGif(GifByteType *OutputBuffer, int Width, int Height,
|
|
|
|
|
|
for (i = 0; i < Height; i++) {
|
|
|
if (EGifPutLine(GifFile, Ptr, Width) == GIF_ERROR) {
|
|
@@ -45,7 +47,7 @@ index d9a469f..02cea41 100644
|
|
|
exit(EXIT_FAILURE);
|
|
|
}
|
|
|
GifQprintf("\b\b\b\b%-4d", Height - i - 1);
|
|
|
-@@ -196,6 +203,8 @@ static void SaveGif(GifByteType *OutputBuffer,
|
|
|
+@@ -191,6 +197,8 @@ static void SaveGif(GifByteType *OutputBuffer, int Width, int Height,
|
|
|
|
|
|
if (EGifCloseFile(GifFile, &Error) == GIF_ERROR) {
|
|
|
PrintGifError(Error);
|