sixel: Handle NULL pointer

When reading /dev/urandom, sixel_add_ar_11() gets triggered, which didn't properly handle the possibility of a NULL pointer, causing the program to segfault.
This commit is contained in:
justwolf 2024-03-07 03:04:51 +00:00
parent 1568518ab3
commit 8af7767562

View file

@ -1492,6 +1492,8 @@ sixel_add_ar_11(struct terminal *term, uint32_t *data, int stride, uint32_t colo
xassert(term->sixel.pos.row < term->sixel.image.height); xassert(term->sixel.pos.row < term->sixel.image.height);
xassert(term->sixel.pan == 1); xassert(term->sixel.pan == 1);
if (data == NULL)
return;
if (sixel & 0x01) if (sixel & 0x01)
*data = color; *data = color;
data += stride; data += stride;