[FFmpeg-cvslog] lavf/webvttdec: fix potential timing overflows.

Clément Bœsch git at videolan.org
Sun Oct 21 01:11:02 CEST 2012


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sun Oct 21 01:16:49 2012 +0200| [99a520000d376d60cd30fae97bfaaf13d50ee26c] | committer: Clément Bœsch

lavf/webvttdec: fix potential timing overflows.

Should fix CID733781 and CID733782.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=99a520000d376d60cd30fae97bfaaf13d50ee26c
---

 libavformat/webvttdec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c
index b1cd293..aeb7050 100644
--- a/libavformat/webvttdec.c
+++ b/libavformat/webvttdec.c
@@ -49,8 +49,8 @@ static int webvtt_probe(AVProbeData *p)
 static int64_t read_ts(const char *s)
 {
     int hh, mm, ss, ms;
-    if (sscanf(s, "%u:%u:%u.%u", &hh, &mm, &ss, &ms) == 4) return (hh*3600 + mm*60 + ss) * 1000 + ms;
-    if (sscanf(s,    "%u:%u.%u",      &mm, &ss, &ms) == 3) return (          mm*60 + ss) * 1000 + ms;
+    if (sscanf(s, "%u:%u:%u.%u", &hh, &mm, &ss, &ms) == 4) return (hh*3600LL + mm*60LL + ss) * 1000LL + ms;
+    if (sscanf(s,    "%u:%u.%u",      &mm, &ss, &ms) == 3) return (            mm*60LL + ss) * 1000LL + ms;
     return AV_NOPTS_VALUE;
 }
 



More information about the ffmpeg-cvslog mailing list