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

Commit b0924c63 authored by Wei Jia's avatar Wei Jia Committed by Android Git Automerger
Browse files

am 7af634e1: am 8ec119d2: am d138024f: am b32957db: am a9d7c917: am a99d3d83:...

am 7af634e1: am 8ec119d2: am d138024f: am b32957db: am a9d7c917: am a99d3d83: am 738a753a: SampleTable: fix integer overflow checks.

* commit '7af634e1':
  SampleTable: fix integer overflow checks.
parents ac7cb990 7af634e1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -333,7 +333,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;
    }
@@ -379,7 +379,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;
    }