mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-07 04:06:07 -05:00
sixel: unhook: make sure image height is within bounds
When we allocate the backing buffer, the number of allocated rows is a multiple of 6. When persisting the image, make sure its height does not exceed the current maximum height.
This commit is contained in:
parent
add30a38f3
commit
8ec0f15a34
1 changed files with 4 additions and 0 deletions
4
sixel.c
4
sixel.c
|
|
@ -695,6 +695,10 @@ sixel_reflow(struct terminal *term)
|
|||
void
|
||||
sixel_unhook(struct terminal *term)
|
||||
{
|
||||
/* The internal buffer always as a row number that is a multiple of 6 */
|
||||
term->sixel.image.height = min(
|
||||
term->sixel.image.height, term->sixel.max_height);
|
||||
|
||||
int pixel_row_idx = 0;
|
||||
int pixel_rows_left = term->sixel.image.height;
|
||||
const int stride = term->sixel.image.width * sizeof(uint32_t);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue