summaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-03-07 00:10:11 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-03-07 20:37:33 +0100
commit1b1362e408cd6acb63fef126b814b0d16562aa8e (patch)
tree285694f08e981bc4699037402a99cea8996dca74 /libavformat/utils.c
parentda069e9c68ec1a54e618940dcb9ebae9bf179a32 (diff)
downloadffmpeg-streaming-1b1362e408cd6acb63fef126b814b0d16562aa8e.zip
ffmpeg-streaming-1b1362e408cd6acb63fef126b814b0d16562aa8e.tar.gz
avformat/utils: Fix integer overflow of fps_first/last_dts
Fixes: runtime error: signed integer overflow: 7738135736989908991 - -7898362169240453118 cannot be represented in type 'long' Fixes: Chromium bug 796778 Reported-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3ca1ca2..4d0b56c 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3778,7 +3778,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
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 >
- (st->info->fps_last_dts - st->info->fps_first_dts) /
+ (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,
"DTS discontinuity in stream %d: packet %d with DTS "
OpenPOWER on IntegriCloud