mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
sixel: free backing buffer if final image size is zero
This commit is contained in:
parent
3566be591a
commit
19289bad5e
1 changed files with 5 additions and 0 deletions
5
sixel.c
5
sixel.c
|
|
@ -726,6 +726,11 @@ sixel_unhook(struct terminal *term)
|
|||
term->sixel.image.height = term->sixel.max_non_empty_row_no + 1;
|
||||
}
|
||||
|
||||
if (term->sixel.image.height == 0 || term->sixel.image.width == 0) {
|
||||
/* We won’t be emitting any sixels - free backing image */
|
||||
free(term->sixel.image.data);
|
||||
}
|
||||
|
||||
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