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

Commit 5dfade5b authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge "Guard against sample time overflow"

am: 7639616e

Change-Id: Ia671a67d80f63f7c88763efbe4853d45d5e5e2d2
parents ff95675c 7639616e
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -701,9 +701,15 @@ void SampleTable::buildSampleEntriesTable() {
            }

            ++sampleIndex;
            if (sampleTime > UINT32_MAX - delta) {
                ALOGE("%u + %u would overflow, clamping",
                    sampleTime, delta);
                sampleTime = UINT32_MAX;
            } else {
                sampleTime += delta;
            }
        }
    }

    qsort(mSampleTimeEntries, mNumSampleSizes, sizeof(SampleTimeEntry),
          CompareIncreasingTime);