[FFmpeg-cvslog] avformat/mpl2dec: handle files with CRLF linebreaks correctly

wm4 git at videolan.org
Tue Sep 3 20:45:37 CEST 2013


ffmpeg | branch: master | wm4 <nfxjfg at googlemail.com> | Thu Aug  8 01:04:36 2013 +0200| [060c6c4647530762ab594f62a964cf9f9621e8ce] | committer: Clément Bœsch

avformat/mpl2dec: handle files with CRLF linebreaks correctly

Skip the "\r" as normal text. Otherwise it will be the first character
of the string passed to sscanf(), which then fill fail to match the
timestamps.

Signed-off-by: Clément Bœsch <u at pkh.me>

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

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

diff --git a/libavformat/mpl2dec.c b/libavformat/mpl2dec.c
index b152cc8..ffe1d83 100644
--- a/libavformat/mpl2dec.c
+++ b/libavformat/mpl2dec.c
@@ -43,7 +43,7 @@ static int mpl2_probe(AVProbeData *p)
         if (sscanf(ptr, "[%"SCNd64"][%"SCNd64"]%c", &start, &end, &c) != 3 &&
             sscanf(ptr, "[%"SCNd64"][]%c",          &start,       &c) != 2)
             return 0;
-        ptr += strcspn(ptr, "\r\n") + 1;
+        ptr += strcspn(ptr, "\n") + 1;
         if (ptr >= ptr_end)
             return 0;
     }



More information about the ffmpeg-cvslog mailing list