Commit bf1fd59c authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/avidec: Fix demuxing avi with broken index

Fixes: genio-avi
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 749f8549
......@@ -1681,9 +1681,13 @@ static int guess_ni_flag(AVFormatContext *s)
if (n >= 2) {
int64_t pos = st->index_entries[0].pos;
avio_seek(s->pb, pos + 4, SEEK_SET);
unsigned tag[2];
avio_seek(s->pb, pos, SEEK_SET);
tag[0] = avio_r8(s->pb);
tag[1] = avio_r8(s->pb);
avio_rl16(s->pb);
size = avio_rl32(s->pb);
if (pos + size > st->index_entries[1].pos)
if (get_stream_idx(tag) == i && pos + size > st->index_entries[1].pos)
last_start = INT64_MAX;
}
......
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