1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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

This commit is contained in:
Paul B Mahol 2019-04-25 23:21:38 +02:00
parent 2e254bb897
commit 6347146e3d
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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++;
}