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>
This commit is contained in:
Michael Niedermayer 2020-10-31 12:01:50 +01:00
parent d7f87a4b9e
commit 7d75ecf8d2
1 changed files with 1 additions and 1 deletions

View File

@ -4414,7 +4414,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;