diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-10-12 03:00:32 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-10-23 01:44:41 +0200 |
commit | 51404bb4f6132c054c6266238d483846e6654ad3 (patch) | |
tree | af7626a9a1765f433cb8361da44bb646aba3cdea | |
parent | 4b14c3ed7857e386ae49bd6f1c4124e52d1667f3 (diff) | |
download | ffmpeg-51404bb4f6132c054c6266238d483846e6654ad3.tar.gz |
avformat/utils: Fix integer overflow in discontinuity check
Fixes: signed integer overflow: 7738135736989908991 - -7954308516317364223 cannot be represented in type 'long'
Fixes: find_stream_info_usan
Reported-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4e19cfcfa3944fe4cf97bea758f72f104dcaebad)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 587fad8e1a..8c51824fa0 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3363,7 +3363,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) * sequence, we treat it as a discontinuity. */ if (st->info->fps_last_dts != AV_NOPTS_VALUE && st->info->fps_last_dts_idx > st->info->fps_first_dts_idx && - (pkt->dts - st->info->fps_last_dts) / 1000 > + (pkt->dts - (uint64_t)st->info->fps_last_dts) / 1000 > (st->info->fps_last_dts - (uint64_t)st->info->fps_first_dts) / (st->info->fps_last_dts_idx - st->info->fps_first_dts_idx)) { av_log(ic, AV_LOG_WARNING, |