aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/assdec.c
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2015-11-20 14:38:22 +0100
committerClément Bœsch <clement@stupeflix.com>2015-11-20 14:41:56 +0100
commit6679fcd4198d5050de2d43468dd80d0a2ac90d81 (patch)
treeb2e9c61652f88c967d3cfee97ed69a5f8ac51499 /libavformat/assdec.c
parent7769e6602d2d32144a3e1ca3fa7b06cca5d1c988 (diff)
downloadffmpeg-6679fcd4198d5050de2d43468dd80d0a2ac90d81.tar.gz
avformat/assdec: allow ASS files starting with empty lines
See https://github.com/mpv-player/mpv/issues/2506
Diffstat (limited to 'libavformat/assdec.c')
-rw-r--r--libavformat/assdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index a9a2efac2e..21148b60f9 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -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))