aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-04-15 18:43:25 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-06-18 20:53:56 +0200
commit26369e6ca993796ab054270a1bb685583e7c7eb9 (patch)
tree9ae5af29569bdecfc07ce603f6bfcb67f50e961f
parent246b3d58a956d090b1438b005701608927aca681 (diff)
downloadffmpeg-26369e6ca993796ab054270a1bb685583e7c7eb9.tar.gz
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@niedermayer.cc> (cherry picked from commit ee53bb2399d8f387ac93a18ba0600ca7b04ac634) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 38a70589be..cd56df5b29 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5124,7 +5124,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;