{
uint8_t atom_type;
uint8_t header_size = 0;
- uint64_t subsize, sumsize = 0;
+ uint64_t subsize, sumsize;
char *name = NULL;
char *data = NULL;
uint32_t done = 0;
uint32_t len = 0;
+ uint64_t destpos;
- while (sumsize < size && !f->stream->read_error) { /* CVE-2017-9222 */
- uint64_t destpos;
+ for (
+ sumsize = 0;
+ sumsize < size && !f->stream->read_error; /* CVE-2017-9222 */
+ mp4ff_set_position(f, destpos), sumsize += subsize
+ ) {
subsize = mp4ff_atom_read_header(f, &atom_type, &header_size);
destpos = mp4ff_position(f) + subsize - header_size;
if (done)
name = mp4ff_read_string(f, (uint32_t) (subsize - (header_size + 4)));
}
}
- mp4ff_set_position(f, destpos);
- sumsize += subsize;
}
if (data) {