From 3e6f0e63f3027f19a83c6a2ddcf52018d30f2751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 7 Mar 2024 16:21:06 +0100 Subject: [PATCH] sixel: don't try to emit a sixel if we're outside the image's boundaries Closes #1634 --- sixel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sixel.c b/sixel.c index f3d57fb2..7684e657 100644 --- a/sixel.c +++ b/sixel.c @@ -1549,6 +1549,9 @@ sixel_add_one_ar_11(struct terminal *term, uint8_t c) resize_horizontally(term, col + count); width = term->sixel.image.width; count = min(count, max(width - col, 0)); + + if (unlikely(count == 0)) + return; } sixel_add_ar_11(term, term->sixel.image.p, width, term->sixel.color, c);