avoid bad memory access

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15784 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2005-06-20 14:32:51 +00:00
parent 5ba87d32c6
commit 405c00b388
1 changed files with 3 additions and 1 deletions

View File

@ -996,7 +996,9 @@ static void lschunks(demuxer_t* demuxer,int level,off_t endpos,mov_track_t* trak
}
}
if((trak->stdata[9]==0 || trak->stdata[9]==1) && trak->stdata_len >= 36) { // version 0 with extra atoms
if ((trak->stdata[9] == 0 && trak->stdata_len >= 36) ||
(trak->stdata[9] == 1 && trak->stdata_len >= 36 + 48)) {
// version 0 with extra atoms
int adjust = (trak->stdata[9]==1)?48:0;
int atom_len = char2int(trak->stdata,28+adjust);
switch(char2int(trak->stdata,32+adjust)) { // atom type