sixel: don't try to emit a sixel if we're outside the image's boundaries

Closes #1634
This commit is contained in:
Daniel Eklöf 2024-03-07 16:21:06 +01:00
parent 75fd59df3f
commit 3e6f0e63f3
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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);