From 9264d6695c1e8b4e4bd3d338026d83836ca3d014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 5 May 2021 22:08:14 +0200 Subject: [PATCH] box-drawing: change_buffer_format: abort on pixman failure --- box-drawing.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/box-drawing.c b/box-drawing.c index 05fad40b..25021e31 100644 --- a/box-drawing.c +++ b/box-drawing.c @@ -40,6 +40,12 @@ change_buffer_format(struct buf *buf, pixman_format_code_t new_format) pixman_image_t *new_pix = pixman_image_create_bits_no_clear( new_format, buf->width, buf->height, (uint32_t *)new_data, stride); + if (new_pix == NULL) { + errno = ENOMEM; + perror(__func__); + abort(); + } + pixman_image_unref(buf->pix); free(buf->data);