mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
lavf/srtdec: fix probing files with negative first timestamps
This commit is contained in:
parent
a590d344e3
commit
1df401505c
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user