summaryrefslogtreecommitdiffstats
path: root/libmpdemux
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-01-29 22:14:00 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-01-29 22:14:00 +0000
commit511eccaa7804488f823a5b324d8a5044904d5b55 (patch)
tree8714ccd67074789c00600d73b2e08a577ea3a9f6 /libmpdemux
parent80e4c5d665e2206e9db52c72633bbafb3d3f0976 (diff)
downloadmpv-511eccaa7804488f823a5b324d8a5044904d5b55.tar.bz2
mpv-511eccaa7804488f823a5b324d8a5044904d5b55.tar.xz
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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25922 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_mov.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c
index 1b6ae43a07..8f35803d28 100644
--- a/libmpdemux/demux_mov.c
+++ b/libmpdemux/demux_mov.c
@@ -238,6 +238,8 @@ void mov_build_index(mov_track_t* trak,int timescale){
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,int timescale){
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,