[FFmpeg-cvslog] avformat/dump: Fix integer overflow in av_dump_format()
Michael Niedermayer
git at videolan.org
Sun Dec 6 12:57:24 CET 2015
ffmpeg | branch: release/2.4 | Michael Niedermayer <michael at niedermayer.cc> | Tue Dec 1 12:40:32 2015 +0100| [a3ec4b307b4f688643b46aefb4b50584236a04d3] | committer: Michael Niedermayer
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 at niedermayer.cc>
(cherry picked from commit 8e7f4520226d2d9ad6a58ad6c32d1455a8b244b2)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a3ec4b307b4f688643b46aefb4b50584236a04d3
---
libavformat/dump.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/dump.c b/libavformat/dump.c
index c4434b3..4a88e07 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -430,7 +430,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;
More information about the ffmpeg-cvslog
mailing list