Commit 0e893c08 authored by diego's avatar diego

Check return value of posix_memalign and explicitly set pointer to NULL if it

fails, patch by Patrik Kullman, patrik yes nu.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17495 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 486e0f6e
...@@ -63,7 +63,8 @@ void *av_malloc(unsigned int size) ...@@ -63,7 +63,8 @@ void *av_malloc(unsigned int size)
ptr = (char*)ptr + diff; ptr = (char*)ptr + diff;
((char*)ptr)[-1]= diff; ((char*)ptr)[-1]= diff;
#elif HAVE_POSIX_MEMALIGN #elif HAVE_POSIX_MEMALIGN
posix_memalign(&ptr,16,size); if (posix_memalign(&ptr,16,size))
ptr = NULL;
#elif HAVE_MEMALIGN #elif HAVE_MEMALIGN
ptr = memalign(16,size); ptr = memalign(16,size);
/* Why 64? /* Why 64?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment