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

Commit b016207f authored by Wei Jia's avatar Wei Jia
Browse files

DO NOT MERGE MPEG4Extractor: ensure kKeyTrackID exists before creating an MPEG4Source as track.

GenericSource: return error when no track exists.

SampleIterator: make sure mSamplesPerChunk is not zero before using it as divisor.

Bug: 21657957
Bug: 23705695
Bug: 22802344
Bug: 28799341
Change-Id: I7664992ade90b935d3f255dcd43ecc2898f30b04
(cherry picked from commit 0386c91b)
parent f8429c0c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -883,6 +883,11 @@ status_t MPEG4Extractor::parseChunk(off64_t *offset, int depth) {
            }

            if (isTrack) {
                int32_t trackId;
                // There must be exact one track header per track.
                if (!mLastTrack->meta->findInt32(kKeyTrackID, &trackId)) {
                    mLastTrack->skipTrack = true;
                }
                if (mLastTrack->skipTrack) {
                    Track *cur = mFirstTrack;

+5 −0
Original line number Diff line number Diff line
@@ -84,6 +84,11 @@ status_t SampleIterator::seekTo(uint32_t sampleIndex) {

    CHECK(sampleIndex < mStopChunkSampleIndex);

    if (mSamplesPerChunk == 0) {
        ALOGE("b/22802344");
        return ERROR_MALFORMED;
    }

    uint32_t chunk =
        (sampleIndex - mFirstChunkSampleIndex) / mSamplesPerChunk
        + mFirstChunk;