From 996ce2b3797a1dfaae75a86639e7acf3e285c438 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 18 Jul 2024 18:50:09 +0200 Subject: [PATCH] avformat/mov: Check extradata in mov_read_iacb() Fixes: MemLeak Fixes: 69853/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4660448545275904 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer (cherry picked from commit 167bf8f61e671833c9d1234f12973e71c414b621) Signed-off-by: Michael Niedermayer --- libavformat/mov.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index a4b842ebd6..1af869cb48 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -896,6 +896,11 @@ static int mov_read_iacb(MOVContext *c, AVIOContext *pb, MOVAtom atom) st = c->fc->streams[c->fc->nb_streams - 1]; sc = st->priv_data; + if (st->codecpar->extradata) { + av_log(c->fc, AV_LOG_WARNING, "ignoring iacb\n"); + return 0; + } + sc->iamf = av_mallocz(sizeof(*sc->iamf)); if (!sc->iamf) return AVERROR(ENOMEM);