Browse Source

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: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 86d00ede4f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4.9
Andreas Cadhalpun Michael Niedermayer 11 years ago
parent
commit
9a9379ff7f
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavformat/bink.c

+ 4
- 1
libavformat/bink.c View File

@@ -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;


Loading…
Cancel
Save