Browse code

mem: Trying to workaround posix_memalign() bug on OSX

This patch is based on a patch by John Stebbins

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/06/07 05:59:23
Showing 1 changed files
... ...
@@ -86,6 +86,7 @@ void *av_malloc(size_t size)
86 86
     ptr = (char*)ptr + diff;
87 87
     ((char*)ptr)[-1]= diff;
88 88
 #elif HAVE_POSIX_MEMALIGN
89
+    if (size) //OSX on SDK 10.6 has a broken posix_memalign implementation
89 90
     if (posix_memalign(&ptr,ALIGN,size))
90 91
         ptr = NULL;
91 92
 #elif HAVE_MEMALIGN