diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-03-28 10:57:49 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-03-28 11:22:10 +0000 |
| commit | 19289bad5ef60f4c5ca2b45c0e495db60ed34267 (patch) | |
| tree | e4af4385915f30f8cfb0855b3e03f0e5d5ebbf3f /sixel.c | |
| parent | sixel: initialize max_non_empty_row_no to -1, not 0 (diff) | |
sixel: free backing buffer if final image size is zero
Diffstat (limited to 'sixel.c')
| -rw-r--r-- | sixel.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); |
