aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
author李赞 <lizan@ruc.edu.cn>2017-05-10 14:55:34 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-14 12:20:16 +0200
commita4fb44723dcaa56416173bc3d0ff41e9cda25067 (patch)
treecb070c7e1f7f493ef6f2d386121e576db5980cf6 /libavformat
parent25a592e5d45672bdfdac35bf0119907cdcddd1b7 (diff)
downloadffmpeg-a4fb44723dcaa56416173bc3d0ff41e9cda25067.tar.gz
avformat/wavdec: Check chunk_size
Fixes integer overflow and out of array access Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 3d232196372f309a75ed074c4cef30578eec1782) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/wavdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 7176cd6f2d..8bbb301afc 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -829,6 +829,8 @@ static int w64_read_header(AVFormatContext *s)
chunk_key[4] = 0;
avio_read(pb, chunk_key, 4);
chunk_size = avio_rl32(pb);
+ if (chunk_size == UINT32_MAX)
+ return AVERROR_INVALIDDATA;
value = av_mallocz(chunk_size + 1);
if (!value)