diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-08-26 13:37:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-06 14:41:41 +0200 |
commit | 684a8847e3f62d9789249700d366280ef3dcb60e (patch) | |
tree | bbc2cdf4ae420ca3a46331c197b9a7332b457960 | |
parent | d24e2c121b29e4accf4570880d3ba58cdb44f930 (diff) | |
download | ffmpeg-684a8847e3f62d9789249700d366280ef3dcb60e.tar.gz |
avformat/mov: Check dts for overflow in mov_read_trun()
Fixes: signed integer overflow: 9223372034248226491 + 3275247799 cannot be represented in type 'long'
Fixes: clusterfuzz-testcase-minimized-audio_decoder_fuzzer-4538729166077952
Reported-by: Matt Wolenetz <wolenetz@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4de4bc06fdfd0383f3d9012c6557a38408a09d28)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mov.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index e6208a6550..6de3ab9a68 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4978,6 +4978,8 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom) "size %u, distance %d, keyframe %d\n", st->index, index_entry_pos, offset, dts, sample_size, distance, keyframe); distance++; + if (av_sat_add64(dts, sample_duration) != dts + (uint64_t)sample_duration) + return AVERROR_INVALIDDATA; dts += sample_duration; offset += sample_size; sc->data_size += sample_size; |