Browse Source

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

Fixes Ticket3108

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.3
Michael Niedermayer 11 years ago
parent
commit
46380e8d26
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavformat/aviobuf.c

+ 3
- 1
libavformat/aviobuf.c 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;


Loading…
Cancel
Save