# HG changeset patch # User reimar # Date 1201644840 0 # Node ID 638493dc056e57b7d58d2aff83336ab0bcb85e57 # Parent 68a400e63e67fd03cd2b26b4e392c01435986be1 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. diff -r 68a400e63e67 -r 638493dc056e libmpdemux/demux_mov.c --- a/libmpdemux/demux_mov.c Tue Jan 29 22:13:47 2008 +0000 +++ b/libmpdemux/demux_mov.c Tue Jan 29 22:14:00 2008 +0000 @@ -238,6 +238,8 @@ s=0; for(j=0;jdurmap_size;j++){ for(i=0;idurmap[j].num;i++){ + if (s >= trak->samples_size) + break; trak->samples[s].pts=pts; ++s; pts+=trak->durmap[j].dur; @@ -249,6 +251,8 @@ for(j=0;jchunks_size;j++){ off_t pos=trak->chunks[j].pos; for(i=0;ichunks[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,