提交 a90de11d 编写于 作者: P Patrik Kullman 提交者: Diego Biurrun

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
上级 1bbeb06a
......@@ -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?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册