diff options
author | Joshua J. Drake <android-open-source@qoop.org> | 2015-04-10 23:55:53 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-10 23:55:53 +0000 |
commit | 520434cdf572d13efbca693ae9e42bfe42211b85 (patch) | |
tree | 582d1a6783b6b9128c3bc892658591242c505522 /media | |
parent | 424324b327cc0b022ff8d10e03158b4594489ee7 (diff) | |
parent | 24acf11dbec8e7071f9adcc24fa883c71d005215 (diff) | |
download | frameworks_av-520434cdf572d13efbca693ae9e42bfe42211b85.zip frameworks_av-520434cdf572d13efbca693ae9e42bfe42211b85.tar.gz frameworks_av-520434cdf572d13efbca693ae9e42bfe42211b85.tar.bz2 |
am 24acf11d: am 4a131250: am 030d8d0a: Fix several ineffective integer overflow checks
* commit '24acf11dbec8e7071f9adcc24fa883c71d005215':
Fix several ineffective integer overflow checks
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/SampleTable.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/media/libstagefright/SampleTable.cpp b/media/libstagefright/SampleTable.cpp index bdd6d56..b572af3 100644 --- a/media/libstagefright/SampleTable.cpp +++ b/media/libstagefright/SampleTable.cpp @@ -330,7 +330,7 @@ status_t SampleTable::setTimeToSampleParams( } mTimeToSampleCount = U32_AT(&header[4]); - uint64_t allocSize = mTimeToSampleCount * 2 * sizeof(uint32_t); + uint64_t allocSize = mTimeToSampleCount * 2 * (uint64_t)sizeof(uint32_t); if (allocSize > SIZE_MAX) { return ERROR_OUT_OF_RANGE; } @@ -376,7 +376,7 @@ status_t SampleTable::setCompositionTimeToSampleParams( } mNumCompositionTimeDeltaEntries = numEntries; - uint64_t allocSize = numEntries * 2 * sizeof(uint32_t); + uint64_t allocSize = numEntries * 2 * (uint64_t)sizeof(uint32_t); if (allocSize > SIZE_MAX) { return ERROR_OUT_OF_RANGE; } @@ -426,7 +426,7 @@ status_t SampleTable::setSyncSampleParams(off64_t data_offset, size_t data_size) ALOGV("Table of sync samples is empty or has only a single entry!"); } - uint64_t allocSize = mNumSyncSamples * sizeof(uint32_t); + uint64_t allocSize = mNumSyncSamples * (uint64_t)sizeof(uint32_t); if (allocSize > SIZE_MAX) { return ERROR_OUT_OF_RANGE; } |