From 9a222f140e2674ac936b2f41c480487bc666dd95 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 13 Sep 2021 23:04:13 +0200 Subject: avformat/mov: Check for duplicate clli Fixes: memleak Fixes: 35261/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4869656287510528 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/mov.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavformat') diff --git a/libavformat/mov.c b/libavformat/mov.c index c5583e07c7..4bc42d6b20 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -5485,6 +5485,11 @@ static int mov_read_clli(MOVContext *c, AVIOContext *pb, MOVAtom atom) return AVERROR_INVALIDDATA; } + if (sc->coll){ + av_log(c->fc, AV_LOG_WARNING, "Ignoring duplicate CLLI/COLL\n"); + return 0; + } + sc->coll = av_content_light_metadata_alloc(&sc->coll_size); if (!sc->coll) return AVERROR(ENOMEM); -- cgit v1.2.3