diff mbox series

[FFmpeg-devel,3/9] avformat/mov: Ignore duplicate CoLL

Message ID 20210419182346.4445-3-michael@niedermayer.cc
State Accepted
Commit 9548dc74d8db2bc002e1195dbd076f621f5c3ea1
Headers show
Series [FFmpeg-devel,1/9] avformat/utils: check dts/duration to be representable before using them | expand

Checks

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

Commit Message

Michael Niedermayer April 19, 2021, 6:23 p.m. UTC
Fixes: memleak
Fixes: 32146/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5377612845285376

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/mov.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Michael Niedermayer May 12, 2021, 8:53 p.m. UTC | #1
On Mon, Apr 19, 2021 at 08:23:40PM +0200, Michael Niedermayer wrote:
> Fixes: memleak
> Fixes: 32146/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5377612845285376
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/mov.c | 5 +++++
>  1 file changed, 5 insertions(+)

will apply

[...]
diff mbox series

Patch

diff --git a/libavformat/mov.c b/libavformat/mov.c
index add1e94641..3436fb6b73 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5501,6 +5501,11 @@  static int mov_read_coll(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     }
     avio_skip(pb, 3); /* flags */
 
+    if (sc->coll){
+        av_log(c->fc, AV_LOG_WARNING, "Ignoring duplicate COLL\n");
+        return 0;
+    }
+
     sc->coll = av_content_light_metadata_alloc(&sc->coll_size);
     if (!sc->coll)
         return AVERROR(ENOMEM);