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

Commit 17d791ad authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge "Guard against sample time overflow" am: 7639616e am: 5dfade5b

am: 33d1c4ed

Change-Id: I7cb4bfd82c1882d53177aba82dd7849c21692dd6
parents 6d616e69 33d1c4ed
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);