Browse Source

lavf/webvttdec: fix potential timing overflows.

Should fix CID733781 and CID733782.
tags/n1.1
Clément Bœsch 12 years ago
parent
commit
99a520000d
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavformat/webvttdec.c

+ 2
- 2
libavformat/webvttdec.c View File

@@ -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;
}



Loading…
Cancel
Save