[FFmpeg-cvslog] avformat/aviobuf/ff_get_line: also accept \r as end of line character
Michael Niedermayer
git at videolan.org
Sat May 17 23:58:57 CEST 2014
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue May 13 00:03:30 2014 +0200| [46380e8d261920eed8687eb0eabb8d8726239583] | committer: Michael Niedermayer
avformat/aviobuf/ff_get_line: also accept \r as end of line character
Fixes Ticket3108
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=46380e8d261920eed8687eb0eabb8d8726239583
---
libavformat/aviobuf.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 32a1f92..738459e 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;
More information about the ffmpeg-cvslog
mailing list