Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-11-28 23:20:43 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-10 17:04:26 +0300
commitbd899b2ceebcc6f2ce624fda7be4cfc4bef6a015 (patch)
tree7ec48b851baf57394948728c12762990b4b60f77 /libavformat/mov.c
parent1adc3490110dc44ba8ed5ec056deb7d0044ca2c9 (diff)
avformat/mov: Check a.size before computing next_root_atom
Fixes: signed integer overflow: 64 + 9223372036854775799 cannot be represented in type 'long' Fixes: 27563/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6244650163372032 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 8c9a5a0fe9f27be35332a2b8f604dc85d219a056) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index e654e351e0..09d55da624 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6892,7 +6892,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
c->atom_depth --;
return err;
}
- if (c->found_moov && c->found_mdat &&
+ if (c->found_moov && c->found_mdat && a.size <= INT64_MAX - start_pos &&
((!(pb->seekable & AVIO_SEEKABLE_NORMAL) || c->fc->flags & AVFMT_FLAG_IGNIDX || c->frag_index.complete) ||
start_pos + a.size == avio_size(pb))) {
if (!(pb->seekable & AVIO_SEEKABLE_NORMAL) || c->fc->flags & AVFMT_FLAG_IGNIDX || c->frag_index.complete)