[FFmpeg-cvslog] avformat/mov: check for pts overflow in mov_read_sidx()

Michael Niedermayer git at videolan.org
Thu Apr 22 16:54:45 EEST 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Apr 15 18:43:25 2021 +0200| [ee53bb2399d8f387ac93a18ba0600ca7b04ac634] | committer: Michael Niedermayer

avformat/mov: check for pts overflow in mov_read_sidx()

Fixes: signed integer overflow: 9223372036846336888 + 4278255871 cannot be represented in type 'long'
Fixes: 32782/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6059216516284416

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=ee53bb2399d8f387ac93a18ba0600ca7b04ac634
---

 libavformat/mov.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9ca1ac89a8..bf29060973 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5111,7 +5111,9 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         if (frag_stream_info)
             frag_stream_info->sidx_pts = timestamp;
 
-        if (av_sat_add64(offset, size) != offset + size)
+        if (av_sat_add64(offset, size) != offset + size ||
+            av_sat_add64(pts, duration) != pts + (uint64_t)duration
+        )
             return AVERROR_INVALIDDATA;
         offset += size;
         pts += duration;



More information about the ffmpeg-cvslog mailing list