diff --git a/src/allocator.c b/src/allocator.c index b9b2d02a1..bb0c009fa 100644 --- a/src/allocator.c +++ b/src/allocator.c @@ -147,6 +147,11 @@ sixel_allocator_malloc( assert(allocator); assert(allocator->fn_malloc); + if (n == 0) { + sixel_helper_set_additional_message( + "sixel_allocator_malloc: called with n == 0"); + return NULL; + } return allocator->fn_malloc(n); }