mem: Trying to workaround posix_memalign() bug on OSX
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 6 Jun 2011 20:59:23 +0000 (22:59 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 7 Jun 2011 01:17:42 +0000 (03:17 +0200)
This patch is based on a patch by John Stebbins

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavutil/mem.c

index 29ecbfa..87c2008 100644 (file)
@@ -86,6 +86,7 @@ void *av_malloc(size_t size)
     ptr = (char*)ptr + diff;
     ((char*)ptr)[-1]= diff;
 #elif HAVE_POSIX_MEMALIGN
+    if (size) //OSX on SDK 10.6 has a broken posix_memalign implementation
     if (posix_memalign(&ptr,ALIGN,size))
         ptr = NULL;
 #elif HAVE_MEMALIGN