Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2016-06-06 21:26:36 +0300
committerRodger Combs <rodger.combs@gmail.com>2016-06-25 23:50:03 +0300
commit1df401505c6d209961016ba881d18bedf6af61eb (patch)
treed9c43c0fda1339cd12765be1d3ffdeea590fab9d /libavformat/srtdec.c
parenta590d344e3164f5616d0fe85daee45dd834c4841 (diff)
lavf/srtdec: fix probing files with negative first timestamps
Diffstat (limited to 'libavformat/srtdec.c')
-rw-r--r--libavformat/srtdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index 585aa6a4c3..9ab7a4ef36 100644
--- a/libavformat/srtdec.c
+++ b/libavformat/srtdec.c
@@ -52,7 +52,10 @@ static int srt_probe(AVProbeData *p)
/* Check if the next line matches a SRT timestamp */
if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0)
return 0;
- if (buf[0] >= '0' && buf[0] <= '9' && strstr(buf, " --> ")
+ pbuf = buf;
+ if (buf[0] == '-')
+ pbuf++;
+ if (pbuf[0] >= '0' && pbuf[0] <= '9' && strstr(buf, " --> ")
&& sscanf(buf, "%*d:%*d:%*d%*1[,.]%*d --> %*d:%*d:%*d%*1[,.]%d", &v) == 1)
return AVPROBE_SCORE_MAX;