[FFmpeg-cvslog] bink: check vst->index_entries before using it

Andreas Cadhalpun git at videolan.org
Wed Jun 17 22:09:48 CEST 2015


ffmpeg | branch: release/2.2 | Andreas Cadhalpun <andreas.cadhalpun at googlemail.com> | Wed Apr 22 17:08:51 2015 +0200| [940b9484dcde8fe25ce1c85cfa698f0493aa9395] | committer: Michael Niedermayer

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

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=940b9484dcde8fe25ce1c85cfa698f0493aa9395
---

 libavformat/bink.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/bink.c b/libavformat/bink.c
index ec9257b..7bcd9ee 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;



More information about the ffmpeg-cvslog mailing list