aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-31 12:01:50 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-02-02 14:18:21 +0100
commitc1f7a4153ef3aefe64695ec01fb66564e2acb51f (patch)
treea8c783d49cdcde3874dab7c618851b76fd6b314a
parent57c535996ebdb8d8c8c2eeda3a517661e2473d89 (diff)
downloadffmpeg-c1f7a4153ef3aefe64695ec01fb66564e2acb51f.tar.gz
avformat/mov: Avoid overflow in end computation in mov_read_custom()
Fixes: signed integer overflow: 18 + 9223372036854775799 cannot be represented in type 'long' Fixes: 26731/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5696846019952640 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 7d75ecf8d2d2d05220ca2a3e4177c988b1901774) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4550abd25c..8771a8d6b7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4396,7 +4396,7 @@ static int mov_read_keys(MOVContext *c, AVIOContext *pb, MOVAtom atom)
static int mov_read_custom(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
- int64_t end = avio_tell(pb) + atom.size;
+ int64_t end = av_sat_add64(avio_tell(pb), atom.size);
uint8_t *key = NULL, *val = NULL, *mean = NULL;
int i;
int ret = 0;