summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2014-12-03 19:05:56 +0100
committerMichael Niedermayer <[email protected]>2014-12-20 02:25:54 +0100
commitc4e18917d4f7cf9ff27895330e43289f2ac00e89 (patch)
treec739ecd5e0689849640c2a25e064197e1114bc42
parent03fbc282ff5867db540d4b22d897821bcc416124 (diff)
avformat/aviobuf: Fix infinite loop in ff_get_line()
Fixes ticket4152 Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit eac5c7b8377f3f0e8262ab44e5ccb2c7ed060cdd) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/aviobuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 9795ba46df..b1752cd234 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -674,7 +674,7 @@ int ff_get_line(AVIOContext *s, char *buf, int maxlen)
if (c && i < maxlen-1)
buf[i++] = 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);
buf[i] = 0;