Commit 3d232196 authored by 李赞's avatar 李赞 Committed by Michael Niedermayer

avformat/wavdec: Check chunk_size

Fixes integer overflow and out of array access
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5871adc9
......@@ -841,6 +841,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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment