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
..
arm remove iwmmxt optimizations 2012-03-12 22:46:56 +01:00
avr32 Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00
bfin Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00
mips Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00
ppc configure: Do not unconditionally add -D_POSIX_C_SOURCE to CPPFLAGS. 2011-05-12 11:41:59 +02:00
sh4 Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00
tomi Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00
x86 x86inc: add *mp named argument support to DEFINE_ARGS. 2012-03-14 20:09:53 -07:00
adler32.c tests/examples: Mark some variables only used within their files as static. 2011-12-08 01:01:00 +01:00
adler32.h doxy: provide a start page and document libavutil 2011-11-22 17:16:02 +01:00
aes.c Replace Subversion revisions in comments by Git hashes. 2011-12-21 09:04:25 +01:00
aes.h doxy: provide a start page and document libavutil 2011-11-22 17:16:02 +01:00
attributes.h Add av_printf_format, for marking printf style format strings and their parameters 2011-06-23 20:17:44 +03:00
audioconvert.c audioconvert: make av_get_channel_layout accept composite names. 2012-04-08 18:35:49 -04:00
audioconvert.h audioconvert: make av_get_channel_layout accept composite names. 2012-04-08 18:35:49 -04:00
avassert.h multiple inclusion guard cleanup 2011-05-21 13:48:10 +02:00
avstring.c avstring: Add locale independent implementations of strcasecmp/strncasecmp 2011-11-06 11:52:56 +02:00
avstring.h doxygen: misc consistency, spelling and wording fixes 2011-12-12 23:06:23 +01:00
avutil.h avutil: use align == 0 for default alignment in audio sample buffer functions 2012-04-09 10:20:35 -04:00
base64.c Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00
base64.h doxy: provide a start page and document libavutil 2011-11-22 17:16:02 +01:00
bswap.h bswap: make generic implementation more compiler-friendly 2011-12-12 12:14:14 +00:00
colorspace.h Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00
common.h Add av_popcount64 2012-01-03 14:25:43 +01:00
cpu.c remove iwmmxt optimizations 2012-03-12 22:46:56 +01:00
cpu.h remove iwmmxt optimizations 2012-03-12 22:46:56 +01:00
crc_data.h Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00
crc.c Code clean-up for crc.c, lfg.c, log.c, random_see.d, rational.c and tree.c. 2011-12-03 15:13:48 -08:00
crc.h cosmetics: Remove extra newlines at EOF 2012-01-27 17:19:09 -08:00
des.c des: add possibility to calculate DES-CBC-MAC with small buffer 2011-09-21 08:28:20 +02:00
des.h des: add possibility to calculate DES-CBC-MAC with small buffer 2011-09-21 08:28:20 +02:00
dict.c Remove leftover includes of strings.h 2011-11-06 11:53:05 +02:00
dict.h docs: Fix a stray reference to tags in the generic doxy on dicts 2012-03-19 16:07:38 +02:00
error.c avutil: add AVERROR_UNKNOWN 2012-02-25 11:49:41 -05:00
error.h avutil: add AVERROR_UNKNOWN 2012-02-25 11:49:41 -05:00
eval.c Mark mutable static data const where appropriate. 2012-02-21 09:47:07 -08:00
eval.h Fix a bunch of common typos. 2011-12-11 00:32:25 +01:00
fifo.c fifo: add FIFO API test program, and fate test 2011-08-26 20:54:36 +02:00
fifo.h doxygen: drop another pointless star from pointer variable name 2011-08-27 14:00:54 +02:00
file.c libavutil: Remove pointless file test program. 2012-01-26 22:44:37 +01:00
file.h doxygen: fix usage of @file directive in libavutil/{dict,file}.h 2011-07-01 15:12:33 +02:00
imgutils.c Replace memset(0) by zero initializations. 2012-03-28 09:38:33 +02:00
imgutils.h doxy: provide a start page and document libavutil 2011-11-22 17:16:02 +01:00
internal.h doxygen: misc consistency, spelling and wording fixes 2011-12-12 23:06:23 +01:00
intfloat_readwrite.c cosmetics: Remove extra newlines at EOF 2012-01-27 17:19:09 -08:00
intfloat_readwrite.h lavu: replace int/float punning functions 2011-12-11 18:47:19 +00:00
intfloat.h lavu: replace int/float punning functions 2011-12-11 18:47:19 +00:00
intmath.h doxy: provide a start page and document libavutil 2011-11-22 17:16:02 +01:00
intreadwrite.h intreadwrite.h: fix AV_RL32/AV_RB32 signedness. 2011-06-16 20:49:19 +02:00
inverse.c inverse.c: Replace unnecessary intmath.h header by necessary stdint.h. 2011-06-07 10:31:26 +02:00
lfg.c cosmetics: Consistently place static, inline and av_cold attributes/keywords. 2012-04-04 14:54:13 +02:00
lfg.h doxygen: Drop array size declarations from Doxygen parameter names. 2011-07-03 18:30:02 +02:00
libavutil.v Add symbol versioning for shared libraries 2010-01-16 04:49:02 +00:00
libm.h Provide a fallback version of the libm function trunc 2011-04-21 14:13:09 +03:00
lls.c lls: use av_lfg instead of rand() in test program 2011-07-11 21:09:27 +01:00
lls.h Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00
log.c Code clean-up for crc.c, lfg.c, log.c, random_see.d, rational.c and tree.c. 2011-12-03 15:13:48 -08:00
log.h log.h: make AVClass a named struct 2011-10-12 23:39:31 +02:00
lzo.c libavutil: Remove broken and pointless lzo test program. 2012-03-26 13:00:09 +02:00
lzo.h doxygen: Replace '\' by '@' in Doxygen markup tags. 2011-12-07 15:29:14 +01:00
Makefile build: Only clean the architecture subdirectory we build for. 2012-03-26 13:29:03 +02:00
mathematics.c avutil: add av_rescale_q_rnd() to allow different rounding 2012-02-20 15:08:40 -05:00
mathematics.h avutil: add av_rescale_q_rnd() to allow different rounding 2012-02-20 15:08:40 -05:00
md5.c md5: cosmetics 2011-07-03 18:19:19 +01:00
md5.h cosmetics: Remove extra newlines at EOF 2012-01-27 17:19:09 -08:00
mem.c mem: Consistently return NULL for av_malloc(0) 2012-04-10 11:56:42 +03:00
mem.h doxy: provide a start page and document libavutil 2011-11-22 17:16:02 +01:00
opt.c AVOptions: don't return an invalid option when option list is empty 2011-11-11 08:27:16 +01:00
opt.h doxy: provide a start page and document libavutil 2011-11-22 17:16:02 +01:00
parseutils.c Replace memset(0) by zero initializations. 2012-03-28 09:38:33 +02:00
parseutils.h doxygen: misc consistency, spelling and wording fixes 2011-12-12 23:06:23 +01:00
pixdesc.c pixdesc: mark pseudopaletted formats with a special flag. 2012-02-08 21:01:31 +01:00
pixdesc.h pixdesc: mark pseudopaletted formats with a special flag. 2012-02-08 21:01:31 +01:00
pixfmt.h Revert "sws/pixfmt/pixdesc: add support for yuva444p" 2012-01-26 18:06:57 -08:00
random_seed.c Code clean-up for crc.c, lfg.c, log.c, random_see.d, rational.c and tree.c. 2011-12-03 15:13:48 -08:00
random_seed.h doxy: provide a start page and document libavutil 2011-11-22 17:16:02 +01:00
rational.c libavutil: Remove pointless rational test program. 2012-03-26 13:00:09 +02:00
rational.h doxy: provide a start page and document libavutil 2011-11-22 17:16:02 +01:00
rc4.c Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00
rc4.h doxygen: Consistently use '@' instead of '\' for Doxygen markup. 2011-06-24 00:37:49 +02:00
samplefmt.c avutil: use align == 0 for default alignment in audio sample buffer functions 2012-04-09 10:20:35 -04:00
samplefmt.h avutil: use align == 0 for default alignment in audio sample buffer functions 2012-04-09 10:20:35 -04:00
sha.c Move some conditionally used variables into the block where they are used. 2012-02-13 19:20:54 +01:00
sha.h doxy: provide a start page and document libavutil 2011-11-22 17:16:02 +01:00
timer.h timer: K&R formatting cosmetics 2012-01-05 14:48:30 +01:00
tree.c Code clean-up for crc.c, lfg.c, log.c, random_see.d, rational.c and tree.c. 2011-12-03 15:13:48 -08:00
tree.h doxy: provide a start page and document libavutil 2011-11-22 17:16:02 +01:00
utils.c lavc: deprecate FF_*_TYPE macros in favor of AV_PICTURE_TYPE_* enums 2011-04-26 08:38:57 +02:00
x86_cpu.h Replace FFmpeg with Libav in licence headers 2011-03-19 13:33:20 +00:00