diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-15 22:41:31 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-10 17:04:26 +0300 |
commit | 4df5e76723febd0363ed47f662323945cf6648ea (patch) | |
tree | f05af51eb25d5864fa1e54ab6020a22fcc5bfcd3 /libavformat/mov.c | |
parent | a9c3bade3b2de58d9c6cdac65844aa78a372b3cc (diff) |
avformat/mov: Check element count in mov_metadata_hmmt()
Fixes: Timeout
Fixes: 30325/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6048395703746560
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 1d277b92fa4c149d589e6828d4e18ad578406f1f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 38504e5251..43ae7e6cdf 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -288,6 +288,8 @@ static int mov_metadata_hmmt(MOVContext *c, AVIOContext *pb, unsigned len) return 0; n_hmmt = avio_rb32(pb); + if (n_hmmt > len / 4) + return AVERROR_INVALIDDATA; for (i = 0; i < n_hmmt && !pb->eof_reached; i++) { int moment_time = avio_rb32(pb); avpriv_new_chapter(c->fc, i, av_make_q(1, 1000), moment_time, AV_NOPTS_VALUE, NULL); |