aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2023-06-22 20:12:02 +0000
committerDaniel Eklöf <daniel@ekloef.se>2023-06-24 05:31:08 +0000
commit2388015b105f420f42161b5a625dda8f6b9ebdb6 (patch)
treedcf6f330fced533dd264c9a1c158c22396f604f3
parentsixel: ensure enough rows have been scrolled in, to fit the image (diff)
sixel: assert upper pixel of last sixel maps to last image row, *or lower*
-rw-r--r--sixel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sixel.c b/sixel.c
index 3334c085..b0746a9a 100644
--- a/sixel.c
+++ b/sixel.c
@@ -1084,6 +1084,8 @@ sixel_unhook(struct terminal *term)
const int upper_pixel_last_sixel = (sixel_rows - 1) * sixel_row_height;
const int term_rows = (upper_pixel_last_sixel + term->cell_height - 1) / term->cell_height;
+ xassert(term_rows <= image.rows);
+
row -= (image.rows - term_rows);
term_cursor_to(