]> git.sesse.net Git - ffmpeg/commitdiff
avformat/srtdec: more lenient first line probing
authorClément Bœsch <clement@stupeflix.com>
Thu, 1 Oct 2015 09:48:45 +0000 (11:48 +0200)
committerClément Bœsch <clement@stupeflix.com>
Thu, 1 Oct 2015 09:48:45 +0000 (11:48 +0200)
Fixes Ticket #4898

libavformat/srtdec.c

index ac0fb55771c586c4a3796ca24bf91fb0e0373261..e9cd6474b0c1477f889dc5961cec04f985a79c62 100644 (file)
@@ -41,9 +41,11 @@ static int srt_probe(AVProbeData *p)
         ff_text_r8(&tr);
 
     /* 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 ||
-        strtol(buf, &pbuf, 10) < 0 || *pbuf)
+        strtol(buf, &pbuf, 10) < 0)
         return 0;
 
     /* Check if the next line matches a SRT timestamp */