diff mem.c @ 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 70bdd5501662
children 14e19b1c0cd5
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?