Commit 43abef9f authored by Michael Niedermayer's avatar Michael Niedermayer

rpl: Fix near infinite loop in index reading due to missing eof check.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 282bb028
......@@ -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,
......
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