[FFmpeg-cvslog] r17495 - trunk/libavutil/mem.c

diego subversion
Sat Feb 21 21:38:28 CET 2009


Author: diego
Date: Sat Feb 21 21:38:27 2009
New Revision: 17495

Log:
Check return value of posix_memalign and explicitly set pointer to NULL if it
fails, patch by Patrik Kullman, patrik yes nu.

Modified:
   trunk/libavutil/mem.c

Modified: trunk/libavutil/mem.c
==============================================================================
--- trunk/libavutil/mem.c	Sat Feb 21 21:35:58 2009	(r17494)
+++ trunk/libavutil/mem.c	Sat Feb 21 21:38:27 2009	(r17495)
@@ -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?




More information about the ffmpeg-cvslog mailing list