From 644c8ef879cfae9666cce87f83936a38dad1d34d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 27 Jun 2020 15:34:54 +0200 Subject: [PATCH] grid: add TODO, and an assert, that sixels must not cross wrap-around --- grid.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/grid.c b/grid.c index 1347c863..ee10f38b 100644 --- a/grid.c +++ b/grid.c @@ -123,6 +123,10 @@ grid_reflow(struct grid *grid, int new_rows, int new_cols, struct sixel six = it->item; six.pos.row = new_row_idx; + /* TODO: ensure sixels don't span across the wrap-around */ + int end __attribute__((unused)) = (six.pos.row + six.rows - 1) & (new_rows - 1); + assert(end >= six.pos.row); + tll_push_back(new_sixels, six); tll_remove(grid->sixel_images, it); }