lavf/srtdec: fix probing files with negative first timestamps

This commit is contained in:
Rodger Combs 2016-06-06 13:26:36 -05:00
parent a590d344e3
commit 1df401505c
No known key found for this signature in database
GPG Key ID: E3E54DCDCD3CB843

View File

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