diff --git a/libavutil/mem.c b/libavutil/mem.c index f21e918e1510a9837cd257143587664dabbe15e2..741450b53faad14df4067cc3f232c98d6955f815 100644 --- a/libavutil/mem.c +++ b/libavutil/mem.c @@ -63,7 +63,8 @@ void *av_malloc(unsigned int size) ptr = (char*)ptr + diff; ((char*)ptr)[-1]= diff; #elif HAVE_POSIX_MEMALIGN - posix_memalign(&ptr,16,size); + if (posix_memalign(&ptr,16,size)) + ptr = NULL; #elif HAVE_MEMALIGN ptr = memalign(16,size); /* Why 64?