Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8082425b authored by Marco Nelissen's avatar Marco Nelissen Committed by Dongwon Kang
Browse files

Skip track if verification fails

Bug: 62187433
Test: ran poc, CTS
Merged-In: Ib9b0b6de88d046d8149e9ea5073d6c40ffec7b0c
Change-Id: Ib9b0b6de88d046d8149e9ea5073d6c40ffec7b0c
parent 502c2f40
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -853,6 +853,12 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
                ALOGE("moov: depth %d", depth);
                return ERROR_MALFORMED;
            }

            if (chunk_type == FOURCC('m', 'o', 'o', 'v') && mInitCheck == OK) {
                ALOGE("duplicate moov");
                return ERROR_MALFORMED;
            }

            if (chunk_type == FOURCC('s', 't', 'b', 'l')) {
                ALOGV("sampleTable chunk is %d bytes long.", (size_t)chunk_size);

@@ -920,6 +926,12 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
                if (!mLastTrack->meta->findInt32(kKeyTrackID, &trackId)) {
                    mLastTrack->skipTrack = true;
                }

                status_t err = verifyTrack(mLastTrack);
                if (err != OK) {
                    mLastTrack->skipTrack = true;
                }

                if (mLastTrack->skipTrack) {
                    Track *cur = mFirstTrack;

@@ -937,12 +949,6 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {

                    return OK;
                }

                status_t err = verifyTrack(mLastTrack);

                if (err != OK) {
                    return err;
                }
            } else if (chunk_type == FOURCC('m', 'o', 'o', 'v')) {
                mInitCheck = OK;