mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-25 06:46:36 -04:00
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:
parent
1568518ab3
commit
8af7767562
1 changed files with 2 additions and 0 deletions
2
sixel.c
2
sixel.c
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue