diff mbox series

[FFmpeg-devel,1/5] avformat/vqf: Check len for COMM chunks

Message ID 20201102002128.6685-1-michael@niedermayer.cc
State Accepted
Commit a834af133b1fe8f29b4075808710ffd98abcac40
Headers show
Series [FFmpeg-devel,1/5] avformat/vqf: Check len for COMM chunks
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Michael Niedermayer Nov. 2, 2020, 12:21 a.m. UTC
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>
---
 libavformat/vqf.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer Dec. 4, 2020, 4:30 p.m. UTC | #1
On Mon, Nov 02, 2020 at 01:21:24AM +0100, Michael Niedermayer wrote:
> 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>
> ---
>  libavformat/vqf.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply

[...]
diff mbox series

Patch

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);