diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-24 19:57:18 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-24 19:57:18 +0100 |
commit | 43abef9fde0cf87153cc9031cad61f75b02cfa01 (patch) | |
tree | 4062b1cf056045c9ecc3ea944ab92ec01e69f40f /libavformat | |
parent | 282bb02839b1ce73963c8e3ee46804f1ade8b12a (diff) | |
download | ffmpeg-43abef9fde0cf87153cc9031cad61f75b02cfa01.tar.gz |
rpl: Fix near infinite loop in index reading due to missing eof check.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/rpl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/rpl.c b/libavformat/rpl.c index 9816cb7c30..7100331d5a 100644 --- a/libavformat/rpl.c +++ b/libavformat/rpl.c @@ -58,7 +58,7 @@ static int read_line(AVIOContext * pb, char* line, int bufsize) break; if (b == '\n') { line[i] = '\0'; - return 0; + return url_feof(pb) ? -1 : 0; } line[i] = b; } @@ -252,7 +252,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) // Read the index avio_seek(pb, chunk_catalog_offset, SEEK_SET); total_audio_size = 0; - for (i = 0; i < number_of_chunks; i++) { + for (i = 0; !error && i < number_of_chunks; i++) { int64_t offset, video_size, audio_size; error |= read_line(pb, line, sizeof(line)); if (3 != sscanf(line, "%"PRId64" , %"PRId64" ; %"PRId64, |