[MPlayer-cvslog] r25922 - trunk/libmpdemux/demux_mov.c

reimar subversion at mplayerhq.hu
Tue Jan 29 23:14:00 CET 2008


Author: reimar
Date: Tue Jan 29 23:14:00 2008
New Revision: 25922

Log:
Check that index is still within bounds of samples array.
Previous check is not enough and the code is not performance critical
so do it the easy way.


Modified:
   trunk/libmpdemux/demux_mov.c

Modified: trunk/libmpdemux/demux_mov.c
==============================================================================
--- trunk/libmpdemux/demux_mov.c	(original)
+++ trunk/libmpdemux/demux_mov.c	Tue Jan 29 23:14:00 2008
@@ -238,6 +238,8 @@ void mov_build_index(mov_track_t* trak,i
     s=0;
     for(j=0;j<trak->durmap_size;j++){
 	for(i=0;i<trak->durmap[j].num;i++){
+	    if (s >= trak->samples_size)
+		break;
 	    trak->samples[s].pts=pts;
 	    ++s;
 	    pts+=trak->durmap[j].dur;
@@ -249,6 +251,8 @@ void mov_build_index(mov_track_t* trak,i
     for(j=0;j<trak->chunks_size;j++){
 	off_t pos=trak->chunks[j].pos;
 	for(i=0;i<trak->chunks[j].size;i++){
+	    if (s >= trak->samples_size)
+		break;
 	    trak->samples[s].pos=pos;
 	    mp_msg(MSGT_DEMUX, MSGL_DBG3, "Sample %5d: pts=%8d  off=0x%08X  size=%d\n",s,
 		trak->samples[s].pts,



More information about the MPlayer-cvslog mailing list