aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-03-07 15:21:06 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-03-07 15:21:06 +0000
commit3e6f0e63f3027f19a83c6a2ddcf52018d30f2751 (patch)
tree2aabe343453ed2033572b5a327acbf8f89ef6fbc
parentsixel: debug: sixel image _may_ be zero-sized (diff)
sixel: don't try to emit a sixel if we're outside the image's boundaries
Closes #1634
-rw-r--r--sixel.c3
1 files changed, 3 insertions, 0 deletions
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);