]> git.sesse.net Git - ffmpeg/commitdiff
avformat/mov: Use av_sat_add64() in mov_read_sidx()
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 31 Oct 2020 11:06:21 +0000 (12:06 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Dec 2020 23:08:33 +0000 (00:08 +0100)
This avoids a potential integer overflow, no testcase is known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mov.c

index ed34130034a3cb846fc9cf7190fc3c7f832c9fcf..2193e06ab787ccac7aedb2d25a3e31be59c00ccd 100644 (file)
@@ -5052,7 +5052,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     int64_t stream_size = avio_size(pb);
-    int64_t offset = avio_tell(pb) + atom.size, pts, timestamp;
+    int64_t offset = av_sat_add64(avio_tell(pb), atom.size), pts, timestamp;
     uint8_t version, is_complete;
     unsigned i, j, track_id, item_count;
     AVStream *st = NULL;