Skip to content

Commit

Permalink
bink: check vst->index_entries before using it
Browse files Browse the repository at this point in the history
This fixes a NULL pointer dereference if vst->duration is 0.

The problem was introduced in commit 0588aca.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
Andreas Cadhalpun authored and michaelni committed Apr 22, 2015
1 parent 4d98015 commit 86d00ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libavformat/bink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 86d00ed

Please sign in to comment.