avformat/assdec: allow ASS files starting with empty lines
authorClément Bœsch <u@pkh.me>
Fri, 20 Nov 2015 13:38:22 +0000 (14:38 +0100)
committerClément Bœsch <clement@stupeflix.com>
Fri, 20 Nov 2015 13:41:56 +0000 (14:41 +0100)
See https://github.com/mpv-player/mpv/issues/2506

libavformat/assdec.c

index a9a2efa..21148b6 100644 (file)
@@ -39,6 +39,9 @@ static int ass_probe(AVProbeData *p)
     FFTextReader tr;
     ff_text_init_buf(&tr, p->buf, p->buf_size);
 
+    while (ff_text_peek_r8(&tr) == '\r' || ff_text_peek_r8(&tr) == '\n')
+        ff_text_r8(&tr);
+
     ff_text_read(&tr, buf, sizeof(buf));
 
     if (!memcmp(buf, "[Script Info]", 13))