off64_t orig_offset = offset;
err = parseChunk(&offset, 0);
- if (offset <= orig_offset) {
+ if (err != OK && err != UNKNOWN_ERROR) {
+ break;
+ } else if (offset <= orig_offset) {
// only continue parsing if the offset was advanced,
// otherwise we might end up in an infinite loop
ALOGE("did not advance: 0x%lld->0x%lld", orig_offset, offset);
break;
} else if (err == OK) {
continue;
- } else if (err != UNKNOWN_ERROR) {
- break;
}
+
uint32_t hdr[2];
if (mDataSource->readAt(offset, hdr, 8) < 8) {
break;