aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-02 20:37:09 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-02 20:44:58 +0100
commit80aa89bdff6e3e9dd6bc58d806db0cbe99403149 (patch)
tree2be28ccfd5cbc7b54a165d9982f0b07ec32861fd
parent936eaa89be5de0eada9d188777427b97e568422a (diff)
downloadffmpeg-80aa89bdff6e3e9dd6bc58d806db0cbe99403149.tar.gz
asfdec: check extradata size before alloc and read
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/asfdec.c2
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);
}