OSDN Git Service

stagefright: propagate error in MPEG4Extractor::readMetaData
authorLajos Molnar <lajos@google.com>
Thu, 31 Jul 2014 19:09:37 +0000 (12:09 -0700)
committerLajos Molnar <lajos@google.com>
Thu, 31 Jul 2014 19:10:50 +0000 (12:10 -0700)
Bug: 16641557
Change-Id: I252825bd767a4581b9fca560f2cabfb37c18e137

media/libstagefright/MPEG4Extractor.cpp

index 19da6ee..0064293 100644 (file)
@@ -489,7 +489,9 @@ status_t MPEG4Extractor::readMetaData() {
         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);
@@ -497,9 +499,8 @@ status_t MPEG4Extractor::readMetaData() {
             break;
         } else if (err == OK) {
             continue;
-        } else if (err != UNKNOWN_ERROR) {
-            break;
         }
+
         uint32_t hdr[2];
         if (mDataSource->readAt(offset, hdr, 8) < 8) {
             break;