From cdcfa63cba479f4130cc260f67ff2a63ca7d62f2 Mon Sep 17 00:00:00 2001 From: Marcos Del Sol Vives Date: Sat, 6 Jan 2024 20:47:24 +0100 Subject: [PATCH] Fix corruption in first line of Waveshare image --- client/src/imgutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/imgutils.c b/client/src/imgutils.c index a51f2cd5e..67facd183 100644 --- a/client/src/imgutils.c +++ b/client/src/imgutils.c @@ -65,7 +65,7 @@ gdImagePtr img_palettize(gdImagePtr rgb, int * palette, int palette_size) { * Note that we are storing two extra values so we don't have to do boundary checking at * the left and right edges of the image. */ - struct ycbcr_t * forward = malloc((gdImageSX(rgb) + 2) * sizeof(struct ycbcr_t)); + struct ycbcr_t * forward = calloc(gdImageSX(rgb) + 2, sizeof(struct ycbcr_t)); if (!forward) { free(pal_ycbcr); gdImageDestroy(res);