Browse code

Fix all malloc(0) issues Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/04/29 09:13:59
Showing 1 changed files
... ...
@@ -71,6 +71,8 @@ void *av_malloc(size_t size)
71 71
     /* let's disallow possible ambiguous cases */
72 72
     if(size > (INT_MAX-32) )
73 73
         return NULL;
74
+    else if(!size)
75
+        size= 1;
74 76
 
75 77
 #if CONFIG_MEMALIGN_HACK
76 78
     ptr = malloc(size+32);