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

Commit 39ff8149 authored by Wei Jia's avatar Wei Jia Committed by Android (Google) Code Review
Browse files

Merge "libstagefright: fix possible overflow in SampleTable.cpp" into mnc-dev

parents 3bf1e0fd 2c5fb0c7
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -336,7 +336,7 @@ status_t SampleTable::setTimeToSampleParams(

    mTimeToSampleCount = U32_AT(&header[4]);
    uint64_t allocSize = (uint64_t)mTimeToSampleCount * 2 * sizeof(uint32_t);
    if (allocSize > SIZE_MAX) {
    if (allocSize > UINT32_MAX) {
        return ERROR_OUT_OF_RANGE;
    }
    mTimeToSample = new (std::nothrow) uint32_t[mTimeToSampleCount * 2];
@@ -384,7 +384,7 @@ status_t SampleTable::setCompositionTimeToSampleParams(

    mNumCompositionTimeDeltaEntries = numEntries;
    uint64_t allocSize = (uint64_t)numEntries * 2 * sizeof(uint32_t);
    if (allocSize > SIZE_MAX) {
    if (allocSize > UINT32_MAX) {
        return ERROR_OUT_OF_RANGE;
    }