diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-02 20:37:09 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-02 20:44:58 +0100 |
commit | 80aa89bdff6e3e9dd6bc58d806db0cbe99403149 (patch) | |
tree | 2be28ccfd5cbc7b54a165d9982f0b07ec32861fd | |
parent | 936eaa89be5de0eada9d188777427b97e568422a (diff) | |
download | ffmpeg-80aa89bdff6e3e9dd6bc58d806db0cbe99403149.tar.gz |
asfdec: check extradata size before alloc and read
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/asfdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 884390141c..2dcdf56adb 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -444,7 +444,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) tag1 = avio_rl32(pb); avio_skip(pb, 20); if (sizeX > 40) { - st->codec->extradata_size = sizeX - 40; + st->codec->extradata_size = ffio_limit(pb, sizeX - 40); st->codec->extradata = av_mallocz(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); avio_read(pb, st->codec->extradata, st->codec->extradata_size); } |