diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-13 02:03:30 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-18 01:49:05 +0400 |
commit | 46380e8d261920eed8687eb0eabb8d8726239583 (patch) | |
tree | f1f1b684c7d3af540aa1bafe60bed5031d699430 /libavformat/aviobuf.c | |
parent | 0ca0b4c29cf750cbb15732cddbe16723a66afda8 (diff) |
avformat/aviobuf/ff_get_line: also accept \r as end of line character
Fixes Ticket3108
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r-- | libavformat/aviobuf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 32a1f92cb8..738459e830 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -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; |