Browse Source

avformat/aviobuf: Fix infinite loop in ff_get_line()

Fixes ticket4152

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eac5c7b837)

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

+ 1
- 1
libavformat/aviobuf.c View File

@@ -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;


Loading…
Cancel
Save