ffmpeg/libavutil
Martin Storsjö 14f063d294 mem: Consistently return NULL for av_malloc(0)
Plain POSIX malloc(0) is allowed to return either NULL or a
non-NULL pointer. The calling code should be ready to handle
a NULL return as a correct return (instead of a failure) if the size
to allocate was 0 - this makes sure the condition is handled
in a consistent way across platforms.

This also avoids calling posix_memalign(&ptr, 32, 0) on OS X,
which returns an invalid pointer (a non-NULL pointer that causes
crashes when passed to av_free).

Abort in debug mode, to help track down issues related to
incorrect handling of this case.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-10 11:56:42 +03:00
..
2012-03-12 22:46:56 +01:00
2011-05-21 13:48:10 +02:00
2012-01-03 14:25:43 +01:00
2012-03-12 22:46:56 +01:00
2012-03-12 22:46:56 +01:00
2012-01-27 17:19:09 -08:00
2011-11-06 11:53:05 +02:00
2012-02-25 11:49:41 -05:00
2012-02-25 11:49:41 -05:00
2011-12-11 00:32:25 +01:00
2011-10-12 23:39:31 +02:00
2011-07-03 18:19:19 +01:00
2012-01-27 17:19:09 -08:00
2012-01-05 14:48:30 +01:00