aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/mem.c
diff options
context:
space:
mode:
authorPatrik Kullman <patrik@yes.nu>2009-02-21 20:38:27 +0000
committerDiego Biurrun <diego@biurrun.de>2009-02-21 20:38:27 +0000
commita90de11dba816f57d01cf10b02eaaf90de24d5bb (patch)
tree31c3f6cfa2ef00d0909b21838a929d899a308005 /libavutil/mem.c
parent1bbeb06a36ec36ce03e1c882c8e97efdc13c9a9b (diff)
downloadffmpeg-a90de11dba816f57d01cf10b02eaaf90de24d5bb.tar.gz
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
Diffstat (limited to 'libavutil/mem.c')
-rw-r--r--libavutil/mem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavutil/mem.c b/libavutil/mem.c
index f21e918e15..741450b53f 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?