1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

avformat/srtdec: more lenient first line probing

Fixes Ticket #4898
This commit is contained in:
Clément Bœsch
2015-10-01 11:48:45 +02:00
parent d161a2a72b
commit 7218352e02

View File

@@ -41,9 +41,11 @@ static int srt_probe(AVProbeData *p)
ff_text_r8(&tr); ff_text_r8(&tr);
/* Check if the first non-empty line is a number. We do not check what the /* Check if the first non-empty line is a number. We do not check what the
* number is because in practice it can be anything. */ * number is because in practice it can be anything.
* Also, that number can be followed by random garbage, so we can not
* unfortunately check that we only have a number. */
if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0 || if (ff_subtitles_read_line(&tr, buf, sizeof(buf)) < 0 ||
strtol(buf, &pbuf, 10) < 0 || *pbuf) strtol(buf, &pbuf, 10) < 0)
return 0; return 0;
/* Check if the next line matches a SRT timestamp */ /* Check if the next line matches a SRT timestamp */