Commit 6347146e authored by Paul B Mahol's avatar Paul B Mahol

avformat/subtitles: ignore extra '\r' at line endings

parent 2e254bb8
......@@ -417,7 +417,7 @@ ptrdiff_t ff_subtitles_read_line(FFTextReader *tr, char *buf, size_t size)
buf[cur++] = c;
buf[cur] = '\0';
}
if (ff_text_peek_r8(tr) == '\r')
while (ff_text_peek_r8(tr) == '\r')
ff_text_r8(tr);
if (ff_text_peek_r8(tr) == '\n')
ff_text_r8(tr);
......
......@@ -188,7 +188,7 @@ static av_always_inline int ff_subtitles_next_line(const char *ptr)
{
int n = strcspn(ptr, "\r\n");
ptr += n;
if (*ptr == '\r') {
while (*ptr == '\r') {
ptr++;
n++;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment