changeset 667:998344532d61 libavutil

Check return value of posix_memalign and explicitly set pointer to NULL if it fails, patch by Patrik Kullman, patrik yes nu.
author diego
date Sat, 21 Feb 2009 20:38:27 +0000
parents 86393a769260
children 8adb1d368c25
files mem.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mem.c	Sat Feb 21 16:03:30 2009 +0000
+++ b/mem.c	Sat Feb 21 20:38:27 2009 +0000
@@ -63,7 +63,8 @@
     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?