[MPlayer-cvslog] r29737 - trunk/libmpdemux/demux_mkv.c

reimar subversion at mplayerhq.hu
Wed Sep 30 09:45:10 CEST 2009


Author: reimar
Date: Wed Sep 30 09:45:10 2009
New Revision: 29737

Log:
Avoid a possible crash if num_cluster_pos is 0.

Modified:
   trunk/libmpdemux/demux_mkv.c

Modified: trunk/libmpdemux/demux_mkv.c
==============================================================================
--- trunk/libmpdemux/demux_mkv.c	Wed Sep 30 09:41:00 2009	(r29736)
+++ trunk/libmpdemux/demux_mkv.c	Wed Sep 30 09:45:10 2009	(r29737)
@@ -2961,7 +2961,7 @@ demux_mkv_seek (demuxer_t *demuxer, floa
           target_filepos = (uint64_t) (target_timecode * mkv_d->last_filepos
                                        / (mkv_d->last_pts * 1000.0));
 
-          max_pos = mkv_d->cluster_positions[mkv_d->num_cluster_pos-1];
+          max_pos = mkv_d->num_cluster_pos ? mkv_d->cluster_positions[mkv_d->num_cluster_pos-1] : 0;
           if (target_filepos > max_pos)
             {
               if ((off_t) max_pos > stream_tell (s))


More information about the MPlayer-cvslog mailing list