Commit eac5c7b8 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/aviobuf: Fix infinite loop in ff_get_line()

Fixes ticket4152
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 868cec58
...@@ -676,7 +676,7 @@ int ff_get_line(AVIOContext *s, char *buf, int maxlen) ...@@ -676,7 +676,7 @@ int ff_get_line(AVIOContext *s, char *buf, int maxlen)
if (c && i < maxlen-1) if (c && i < maxlen-1)
buf[i++] = c; buf[i++] = c;
} while (c != '\n' && c != '\r' && c); } while (c != '\n' && c != '\r' && c);
if (c == '\r' && avio_r8(s) != '\n') if (c == '\r' && avio_r8(s) != '\n' && !avio_feof(s))
avio_skip(s, -1); avio_skip(s, -1);
buf[i] = 0; buf[i] = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment