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

Commit 0bb71dd1 authored by Nick Kralevich's avatar Nick Kralevich Committed by Android Git Automerger
Browse files

am 70fb7a5d: Merge "SampleTable: fix integer overflow checks."

* commit '70fb7a5d':
  SampleTable: fix integer overflow checks.
parents c454fe0c 70fb7a5d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@ status_t SampleTable::setTimeToSampleParams(
    }

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

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