diff options
author | Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> | 2015-04-22 17:08:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-17 21:50:09 +0200 |
commit | 940b9484dcde8fe25ce1c85cfa698f0493aa9395 (patch) | |
tree | b8c6610fc336ad4bb35080aceaea6f1c5598f1c1 | |
parent | e96e0e1333c8292bd7720ee7cb7e44c935aa74a6 (diff) | |
download | ffmpeg-940b9484dcde8fe25ce1c85cfa698f0493aa9395.tar.gz |
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 86d00ede4f9acb02690a0615490173648e1d933c)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/bink.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/bink.c b/libavformat/bink.c index ec9257bca2..7bcd9ee208 100644 --- a/libavformat/bink.c +++ b/libavformat/bink.c @@ -190,7 +190,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; |