[FFmpeg-cvslog] avformat/srtdec: make sure we probe a number

Clément Bœsch git at videolan.org
Fri Oct 9 21:38:58 CEST 2015


ffmpeg | branch: release/2.7 | Clément Bœsch <clement at stupeflix.com> | Fri Oct  9 10:52:58 2015 +0200| [6b6932471ece1fd951b3ebcb5ac116dad94ef153] | committer: Carl Eugen Hoyos

avformat/srtdec: make sure we probe a number

Fixes regression since 7218352e0228028dfa009a3799ec93fd041065f1: WebVTT
files were matching the SRT probing.
(cherry picked from commit 40d9d6de90c3652f4c468ab14976c7faf5e40c07)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6b6932471ece1fd951b3ebcb5ac116dad94ef153
---

 libavformat/srtdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index 7fee0fc..3b1373f 100644
--- a/libavformat/srtdec.c
+++ b/libavformat/srtdec.c
@@ -45,7 +45,7 @@ static int srt_probe(AVProbeData *p)
      * 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)
+        strtol(buf, &pbuf, 10) < 0 || pbuf == buf)
         return 0;
 
     /* Check if the next line matches a SRT timestamp */



More information about the ffmpeg-cvslog mailing list