aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-10-21 01:16:49 +0200
committerClément Bœsch <ubitux@gmail.com>2012-10-21 01:16:49 +0200
commit99a520000d376d60cd30fae97bfaaf13d50ee26c (patch)
tree27a097174e34366abdc4c2aa2f4f955fa93060e5
parent1ea3c03743ec6a7c33312896de3bbdbe7f60d0f5 (diff)
downloadffmpeg-99a520000d376d60cd30fae97bfaaf13d50ee26c.tar.gz
lavf/webvttdec: fix potential timing overflows.
Should fix CID733781 and CID733782.
-rw-r--r--libavformat/webvttdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c
index b1cd2938ee..aeb705095f 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;
}