1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
From: Takatsugu Nokubi <takatsugu.nokubi@robotfund.co.jp>
Date: Mon, 8 Jul 2019 12:20:58 +0900
Subject: size check
---
src/fromsixel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/fromsixel.c b/src/fromsixel.c
index 1d86858..8cc8ce0 100644
--- a/src/fromsixel.c
+++ b/src/fromsixel.c
@@ -290,7 +290,7 @@ image_buffer_resize(
size = (size_t)(width * height);
alt_buffer = (unsigned char *)sixel_allocator_malloc(allocator, size);
- if (alt_buffer == NULL) {
+ if (alt_buffer == NULL || size == 0) {
/* free source image */
sixel_allocator_free(allocator, image->data);
image->data = NULL;
|