diff --git a/libavutil/mem.c b/libavutil/mem.c index 90f8667505..f0f18d1ce9 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -71,6 +71,8 @@ void *av_malloc(size_t size) /* let's disallow possible ambiguous cases */ if(size > (INT_MAX-32) ) return NULL; + else if(!size) + size= 1; #if CONFIG_MEMALIGN_HACK ptr = malloc(size+32);