# HG changeset patch # User reimar # Date 1119277971 0 # Node ID dd5d3924a1abcb19b03c23fdf94c182bab107610 # Parent acd282acf129252ae86649abe32f7bdd256a700b avoid bad memory access diff -r acd282acf129 -r dd5d3924a1ab libmpdemux/demux_mov.c --- a/libmpdemux/demux_mov.c Mon Jun 20 14:30:02 2005 +0000 +++ b/libmpdemux/demux_mov.c Mon Jun 20 14:32:51 2005 +0000 @@ -996,7 +996,9 @@ } } - 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