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

reimar subversion at mplayerhq.hu
Tue Jan 29 23:13:47 CET 2008


Author: reimar
Date: Tue Jan 29 23:13:47 2008
New Revision: 25921

Log:
Make sure chunkmap values are within bounds when using them.


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:13:47 2008
@@ -175,11 +175,12 @@ void mov_build_index(mov_track_t* trak,i
     i=trak->chunkmap_size;
     while(i>0){
 	--i;
-	for(j=trak->chunkmap[i].first;j<last;j++){
+	j=FFMAX(trak->chunkmap[i].first, 0);
+	for(;j<last;j++){
 	    trak->chunks[j].desc=trak->chunkmap[i].sdid;
 	    trak->chunks[j].size=trak->chunkmap[i].spc;
 	}
-	last=trak->chunkmap[i].first;
+	last=FFMIN(trak->chunkmap[i].first, trak->chunks_size);
     }
 
 #if 0



More information about the MPlayer-cvslog mailing list