Browse Source

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

fails, patch by Patrik Kullman, patrik yes nu.

Originally committed as revision 17495 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Patrik Kullman Diego Biurrun 16 years ago
parent
commit
a90de11dba
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavutil/mem.c

+ 2
- 1
libavutil/mem.c View File

@@ -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?


Loading…
Cancel
Save