diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-09-23 19:22:06 -0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-04 03:18:52 +0100 |
commit | 241f15f1c93f5bd661a187e42644220fd89ea7de (patch) | |
tree | 42a3a2b4eb8c569b064e098fec176b2e2077c673 | |
parent | 2137d99086b36b95f589ec19ab3f906d32d31b4a (diff) | |
download | ffmpeg-241f15f1c93f5bd661a187e42644220fd89ea7de.tar.gz |
tta: check for extradata allocation failure in tta demuxer
(cherry picked from commit f540ca22c5fb4504d959c295f55591a9ec2a8859)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/tta.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/tta.c b/libavformat/tta.c index c37039d0da..9df9763c74 100644 --- a/libavformat/tta.c +++ b/libavformat/tta.c @@ -107,6 +107,10 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap) return -1; } st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE); + if (!st->codec->extradata) { + st->codec->extradata_size = 0; + return AVERROR(ENOMEM); + } avio_seek(s->pb, start_offset, SEEK_SET); avio_read(s->pb, st->codec->extradata, st->codec->extradata_size); |