diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2024-03-21 11:37:09 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2024-03-21 11:37:09 +0000 |
commit | aa17f0e0c1c8b3f1d6fc8617613c74f07de66fae (patch) | |
tree | b90b9f0c25c04409339167b9d861eef3c10161f3 /image-sixel.c | |
parent | bf5d3f2e26bb9add9e31d72932aea5580be8b653 (diff) |
Fix crash if SIXEL colour register is invalid and remove SIXEL images before
reflow to avoid a different crash, from Anindya Mukherjee.
Diffstat (limited to 'image-sixel.c')
-rw-r--r-- | image-sixel.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |