From aa17f0e0c1c8b3f1d6fc8617613c74f07de66fae Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 21 Mar 2024 11:37:09 +0000 Subject: Fix crash if SIXEL colour register is invalid and remove SIXEL images before reflow to avoid a different crash, from Anindya Mukherjee. --- image-sixel.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'image-sixel.c') diff --git a/image-sixel.c b/image-sixel.c index 3396a22a..e23d17f9 100644 --- a/image-sixel.c +++ b/image-sixel.c @@ -489,6 +489,9 @@ sixel_print(struct sixel_image *si, struct sixel_image *map, size_t *size) colours = si->colours; ncolours = si->ncolours; } + + if (ncolours == 0) + return (NULL); contains = xcalloc(1, ncolours); len = 8192; -- cgit v1.2.3