From d65bac979db317cfc6e0db1b48d03f668eaa80e9 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 7 Nov 2025 12:36:07 +0000 Subject: [PATCH] Do not try to allocate zero size colours, GitHub issue 4674. --- image-sixel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image-sixel.c b/image-sixel.c index fac7eab9..1c93d7a7 100644 --- a/image-sixel.c +++ b/image-sixel.c @@ -474,7 +474,7 @@ sixel_scale(struct sixel_image *si, u_int xpixel, u_int ypixel, u_int ox, } } - if (colours) { + if (colours && si->ncolours != 0) { new->colours = xmalloc(si->ncolours * sizeof *new->colours); for (i = 0; i < si->ncolours; i++) new->colours[i] = si->colours[i];