Add malloc size check
@@ -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);
}
