comparison mov.c @ 2660:022174d849d5 libavformat

fix issue 225, instead of stoping when wrong atom size is found, limit atom size to what is left, assuming container atom has correct size.. cricket4.3g2 has incorrect moov atom size which indicates that file size should be 2 bytes bigger than it is and quicktime reads it correctly though.
author bcoudurier
date Mon, 22 Oct 2007 14:36:14 +0000
parents 960795567b33
children 9645f395842d
comparison
equal deleted inserted replaced
2659:883daa175be1 2660:022174d849d5
177 a.size = atom.size - total_size; 177 a.size = atom.size - total_size;
178 if (a.size <= 8) 178 if (a.size <= 8)
179 break; 179 break;
180 } 180 }
181 a.size -= 8; 181 a.size -= 8;
182 if(a.size < 0 || a.size > atom.size - total_size) 182 if(a.size < 0)
183 break; 183 break;
184 if (a.size > atom.size - total_size)
185 a.size = atom.size - total_size;
184 186
185 for (i = 0; c->parse_table[i].type != 0L 187 for (i = 0; c->parse_table[i].type != 0L
186 && c->parse_table[i].type != a.type; i++) 188 && c->parse_table[i].type != a.type; i++)
187 /* empty */; 189 /* empty */;
188 190