sixel: limit image size to the one specified in the raster attrs

If a sixel has set an explicit width/height, in its raster attributes,
do *not* allow the image to extend beyond this.

Before this patch, we dynamically resized images if the sixel encoder
emitted sixel data beyond the previously set width/height.

Now, we ignore writes outside the configured size.
This commit is contained in:
Daniel Eklöf 2024-03-04 16:33:58 +01:00
parent f17b989650
commit f7bdc4c5b4
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 18 additions and 1 deletions

View file

@ -677,6 +677,7 @@ struct terminal {
uint32_t *p; /* Pointer into data, for current position */
int width; /* Image width, in pixels */
int height; /* Image height, in pixels */
int alloc_height; /* Image height, in pixels, aligned to 6-pixel boundary */
} image;
/*
@ -687,6 +688,7 @@ struct terminal {
*/
int pan;
int pad;
bool size_locked;
bool scrolling:1; /* Private mode 80 */
bool use_private_palette:1; /* Private mode 1070 */