Commit 86d00ede authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer

bink: check vst->index_entries before using it

This fixes a NULL pointer dereference if vst->duration is 0.

The problem was introduced in commit 0588acaf.
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 4d98015d
......@@ -194,7 +194,10 @@ static int read_header(AVFormatContext *s)
return ret;
}
avio_seek(pb, vst->index_entries[0].pos, SEEK_SET);
if (vst->index_entries)
avio_seek(pb, vst->index_entries[0].pos, SEEK_SET);
else
avio_skip(pb, 4);
bink->current_track = -1;
return 0;
......
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