aboutsummaryrefslogtreecommitdiff
path: root/sixel.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-07-18 14:30:42 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-07-18 14:30:42 +0000
commitf65e062ce4defaa647b43927e462eaf2d683942b (patch)
treea0611ca21f4d808e26b401d60f3e2892a694f53d /sixel.c
parentMerge branch 'crash-when-selection-is-in-scrollback-and-scrollback-is-erased' (diff)
sixel: destroy(): don’t unref a NULL pixman image
Diffstat (limited to 'sixel.c')
-rw-r--r--sixel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sixel.c b/sixel.c
index 86878978..18a9c146 100644
--- a/sixel.c
+++ b/sixel.c
@@ -88,9 +88,10 @@ sixel_init(struct terminal *term, int p1, int p2, int p3)
void
sixel_destroy(struct sixel *sixel)
{
- pixman_image_unref(sixel->pix);
- free(sixel->data);
+ if (sixel->pix != NULL)
+ pixman_image_unref(sixel->pix);
+ free(sixel->data);
sixel->pix = NULL;
sixel->data = NULL;
}