gifsicle/initialize_missing_image.patch

16 lines
633 B
Diff

Set missing image data to 0, rather than leaving it uninitialized.
Avoid valgrind warnings.
diff --git a/src/gifread.c b/src/gifread.c
index d2021ee..e9a58dd 100644
--- a/src/gifread.c
+++ b/src/gifread.c
@@ -373,6 +373,7 @@ read_image_data(Gif_Context *gfc, Gif_Reader *grr)
sprintf(buf, "missing %ld %s of image data", delta,
delta == 1 ? "pixel" : "pixels");
gif_read_error(gfc, 1, buf);
+ memset(&gfc->image[gfc->decodepos], 0, delta);
} else if (delta < -1) {
/* One pixel of superfluous data is OK; that could be the
code == next_code case. */