aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-12-03 17:42:22 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-13 23:39:50 +0200
commitb60f4ff5dd7ca6e41fb660b6a9593a6446d514f5 (patch)
treec716ffdd6d401fa714411ea26315fa0b97b0d383 /libavformat
parentc63fed42930e40b08034c7b0db1139d2739771a8 (diff)
downloadffmpeg-b60f4ff5dd7ca6e41fb660b6a9593a6446d514f5.tar.gz
avformat/mov: Disallow duplicate smdm
Fixes: memleak Fixes: 39879/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5327819907923968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b5ba74053c1ef9f38d9e7b3a036675f06d2b2714) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index aeb3cbbc7e..a4eb4751c3 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4847,6 +4847,9 @@ static int mov_read_smdm(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_log(c->fc, AV_LOG_WARNING, "Unsupported Mastering Display Metadata box version %d\n", version);
return 0;
}
+ if (sc->mastering)
+ return AVERROR_INVALIDDATA;
+
avio_skip(pb, 3); /* flags */
sc->mastering = av_mastering_display_metadata_alloc();