handle malloc failures in ff_get_wav_header
authorMax Horn <max@quendi.de>
Tue, 12 Apr 2011 15:44:20 +0000 (17:44 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Thu, 14 Apr 2011 11:56:09 +0000 (13:56 +0200)
commitca402f32e392590a81a1381dab41c4f9c2c2f98a
tree96fecc535e204b9406e2f888cb1f8ac3ce9b3047
parentad4c50347a46a67807925245e730f738cb4d6562
handle malloc failures in ff_get_wav_header

ff_get_wav_header is reading data from a WAVE file and then uses it
(without validation) to malloc a buffer. It then proceeded to read
data into the buffer, without verifying that the allocation succeeded.

To address this, change ff_get_wav_header to return an error if
allocation failed, and adapted all calling code to handle that error.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavformat/asfdec.c
libavformat/avidec.c
libavformat/dxa.c
libavformat/matroskadec.c
libavformat/riff.c
libavformat/riff.h
libavformat/wav.c
libavformat/wtv.c
libavformat/xwma.c