From 2388015b105f420f42161b5a625dda8f6b9ebdb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 22 Jun 2023 22:12:02 +0200 Subject: [PATCH] sixel: assert upper pixel of last sixel maps to last image row, *or lower* --- sixel.c | 2 ++ 1 file changed, 2 insertions(+) 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(