aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-04-22 17:08:51 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-21 20:43:36 +0200
commit004064912f39377bc947af49d606e3e2c7a30cd7 (patch)
tree01b5a5f211abbaba7a8497bc9694851d39490a8d
parent5ae8df8d37c2af50a3f35550a2010ba2a2760e75 (diff)
downloadffmpeg-004064912f39377bc947af49d606e3e2c7a30cd7.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.c5
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;