[FFmpeg-cvslog] avformat/mov: Avoid overflow in end computation in mov_read_custom()

Michael Niedermayer git at videolan.org
Sat Dec 5 01:11:34 EET 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Oct 31 12:01:50 2020 +0100| [7d75ecf8d2d2d05220ca2a3e4177c988b1901774] | committer: Michael Niedermayer

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 at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7d75ecf8d2d2d05220ca2a3e4177c988b1901774
---

 libavformat/mov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 175d5a3cc2..ed34130034 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -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;



More information about the ffmpeg-cvslog mailing list