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

Commit 65a2670e authored by Andreas Huber's avatar Andreas Huber
Browse files

Don't assert on malformed .mp4 content that contains fewer samples than

described in the time-to-sample box.

Change-Id: Ic6f973212c15012a25f6e849759fd4f14d97e30f
related-to-bug: 4779053
parent 551e9560
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -416,12 +416,16 @@ void SampleTable::buildSampleEntriesTable() {
        uint32_t delta = mTimeToSample[2 * i + 1];

        for (uint32_t j = 0; j < n; ++j) {
            CHECK(sampleIndex < mNumSampleSizes);
            if (sampleIndex < mNumSampleSizes) {
                // Technically this should always be the case if the file
                // is well-formed, but you know... there's (gasp) malformed
                // content out there.

                mSampleTimeEntries[sampleIndex].mSampleIndex = sampleIndex;

                mSampleTimeEntries[sampleIndex].mCompositionTime =
                    sampleTime + getCompositionTimeOffset(sampleIndex);
            }

            ++sampleIndex;
            sampleTime += delta;