aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-12-01 12:40:32 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-12-01 13:26:03 +0100
commit8e7f4520226d2d9ad6a58ad6c32d1455a8b244b2 (patch)
tree9924d79af2deadae00e68c7367d9691b42f2d461 /libavformat
parent7b11eead1b4e08728561595e6b610cf8fe2b7122 (diff)
downloadffmpeg-8e7f4520226d2d9ad6a58ad6c32d1455a8b244b2.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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/dump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 7ed766554b..eaf87fe061 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -496,7 +496,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;