aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-01 20:20:02 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-12-05 00:08:33 +0100
commita834af133b1fe8f29b4075808710ffd98abcac40 (patch)
tree282fcc0a62c0bada38ef857bb155230ca9bb54b5
parentc34004d82f43309f9ea2120edd94f68ec667e796 (diff)
downloadffmpeg-a834af133b1fe8f29b4075808710ffd98abcac40.tar.gz
avformat/vqf: Check len for COMM chunks
Fixes: Infinite loop Fixes: 26696/clusterfuzz-testcase-minimized-ffmpeg_dem_VQF_fuzzer-5648269168082944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/vqf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index 617a9706f4..449f4061f7 100644
--- a/libavformat/vqf.c
+++ b/libavformat/vqf.c
@@ -132,6 +132,9 @@ static int vqf_read_header(AVFormatContext *s)
switch(chunk_tag){
case MKTAG('C','O','M','M'):
+ if (len < 12)
+ return AVERROR_INVALIDDATA;
+
avio_read(s->pb, comm_chunk, 12);
st->codecpar->channels = AV_RB32(comm_chunk ) + 1;
read_bitrate = AV_RB32(comm_chunk + 4);