Fix crash if SIXEL colour register is invalid and remove SIXEL images before

reflow to avoid a different crash, from Anindya Mukherjee.
This commit is contained in:
Nicholas Marriott
2024-03-21 11:37:09 +00:00
parent bf5d3f2e26
commit aa17f0e0c1
4 changed files with 11 additions and 4 deletions

View File

@ -2283,6 +2283,10 @@ screen_write_sixelimage(struct screen_write_ctx *ctx, struct sixel_image *si,
new = sixel_scale(si, 0, 0, 0, y - sy, sx, sy, 1);
sixel_free(si);
si = new;
/* Bail out if the image cannot be scaled. */
if (si == NULL)
return;
sixel_size_in_cells(si, &x, &y);
}