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;