Skip to content

Commit

Permalink
Check return value of posix_memalign and explicitly set pointer to NU…
Browse files Browse the repository at this point in the history
…LL if it

fails, patch by Patrik Kullman, patrik yes nu.

Originally committed as revision 17495 to svn://svn.ffmpeg.org/ffmpeg/trunk
  • Loading branch information
Patrik Kullman authored and DonDiego committed Feb 21, 2009
1 parent 1bbeb06 commit a90de11
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libavutil/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit a90de11

Please sign in to comment.