diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-04-15 06:37:17 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-04-15 06:50:06 +0400 |
commit | 85b21147594101ba2d8e7ea2cfa504c0d1baee5a (patch) | |
tree | 62927788e459965cea1ff4cd23c219fcf0410b0e /libavformat/riff.c | |
parent | 256c5b08bf09cb6403790d731cc1c771d8fb0e94 (diff) | |
parent | a3a0af4fb1237bed0af75868073f9a63db8b1864 (diff) |
Merge commit 'a3a0af4fb1237bed0af75868073f9a63db8b1864'
* commit 'a3a0af4fb1237bed0af75868073f9a63db8b1864':
avutil: make aes and sha api public
handle malloc failures in ff_get_wav_header
add xWMA demuxer
mpegts: force the default timebase
libavcodec: Bump micro after adding the dtx AVOptions
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/riff.c')
-rw-r--r-- | libavformat/riff.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c index a818fe5c94..5a40d9a339 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -488,7 +488,7 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *t * WAVEFORMATEX adds 'WORD cbSize' and basically makes itself * an openended structure. */ -void ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size) +int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size) { int id; @@ -531,6 +531,8 @@ void ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size) codec->extradata_size = cbSize; if (cbSize > 0) { codec->extradata = av_mallocz(codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); + if (!codec->extradata) + return AVERROR(ENOMEM); avio_read(pb, codec->extradata, codec->extradata_size); size -= cbSize; } @@ -544,6 +546,8 @@ void ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size) codec->channels = 0; codec->sample_rate = 0; } + + return 0; } |