diff options
author | Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> | 2015-04-22 17:08:51 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-25 15:06:54 +0200 |
commit | 9a9379ff7fc32e8e259d8c090cd8ccf08b27b09d (patch) | |
tree | 2edc7b8112df02b38ba4539bacffac4cad8ee53e | |
parent | f7a6a6d5917475a2df43751a9e147e09dfcc43a6 (diff) | |
download | ffmpeg-9a9379ff7fc32e8e259d8c090cd8ccf08b27b09d.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 395c8d9aa8..350c64f7bb 100644 --- a/libavformat/bink.c +++ b/libavformat/bink.c @@ -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; |