sixel: ensure 'start' row is not outside the grid row range

This commit is contained in:
Daniel Eklöf 2020-02-24 18:39:58 +01:00
parent 95f7c5586c
commit afa9ac0cfc
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -143,7 +143,9 @@ sixel_unhook(struct terminal *term)
.height = term->sixel.image.height,
.rows = (term->sixel.image.height + term->cell_height - 1) / term->cell_height,
.grid = term->grid,
.pos = (struct coord){term->cursor.point.col, term->grid->offset + term->cursor.point.row},
.pos = (struct coord){
term->cursor.point.col,
(term->grid->offset + term->cursor.point.row) & (term->grid->num_rows - 1)},
};
LOG_DBG("generating %dx%d pixman image", image.width, image.height);