diff options
author | 李赞 <lizan@ruc.edu.cn> | 2017-05-10 14:55:34 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-20 03:41:33 +0200 |
commit | 37f59340bb5616bc7e5abc2fec45f1b8af453b79 (patch) | |
tree | 4906c9069ce76d9ab30fb4fa69d0477aeda4a72e | |
parent | 7bbd92f69d12c8d1f06ae9ae251a9c7734f165c9 (diff) | |
download | ffmpeg-37f59340bb5616bc7e5abc2fec45f1b8af453b79.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>
-rw-r--r-- | libavformat/wavdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c index 666fa31f1a..443a79c743 100644 --- a/libavformat/wavdec.c +++ b/libavformat/wavdec.c @@ -747,6 +747,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) |