diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-03-06 20:31:16 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-03-11 16:32:56 +0000 |
| commit | 8ec0f15a3443765bda6540de7019ef0fe1e96b8f (patch) | |
| tree | 8e99cb91688eeb96f1eeab366556a2d220f98fb8 | |
| parent | scripts: generate-alt-random: sixel: emit DECGRI - Repeat Character (diff) | |
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.
| -rw-r--r-- | sixel.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |
