1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avformat/aviobuf/ff_get_line: also accept \r as end of line character

Fixes Ticket3108

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2014-05-13 00:03:30 +02:00
parent 0ca0b4c29c
commit 46380e8d26

View File

@ -665,7 +665,9 @@ int ff_get_line(AVIOContext *s, char *buf, int maxlen)
c = avio_r8(s);
if (c && i < maxlen-1)
buf[i++] = c;
} while (c != '\n' && c);
} while (c != '\n' && c != '\r' && c);
if (c == '\r' && avio_r8(s) != '\n')
avio_skip(s, -1);
buf[i] = 0;
return i;