aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/dump.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-12-01 12:40:32 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-12-14 16:51:00 +0100
commitcf1f615b67a4a486176b9aeaedeceef0337023e9 (patch)
tree1b9497869b48a535396746a8b1f5bb2bbfec4966 /libavformat/dump.c
parent900039e7dc321ca33db696f7ae11b4058d6494ba (diff)
downloadffmpeg-cf1f615b67a4a486176b9aeaedeceef0337023e9.tar.gz
avformat/dump: Fix integer overflow in av_dump_format()
Fixes part of mozilla bug 1229167 Found-by: Tyson Smith Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 8e7f4520226d2d9ad6a58ad6c32d1455a8b244b2) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/dump.c')
-rw-r--r--libavformat/dump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 7bb593c013..7a746b3e0f 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -493,7 +493,7 @@ void av_dump_format(AVFormatContext *ic, int index,
av_log(NULL, AV_LOG_INFO, " Duration: ");
if (ic->duration != AV_NOPTS_VALUE) {
int hours, mins, secs, us;
- int64_t duration = ic->duration + 5000;
+ int64_t duration = ic->duration + (ic->duration <= INT64_MAX - 5000 ? 5000 : 0);
secs = duration / AV_TIME_BASE;
us = duration % AV_TIME_BASE;
mins = secs / 60;