diff options
author | Joshua J. Drake <android-open-source@qoop.org> | 2015-08-04 03:25:51 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-04 03:25:51 +0000 |
commit | 9c5578c1a3bb00623d6ee99340ce0ce290e6c5a1 (patch) | |
tree | b38320bf09025f670c05a4591cd7200ae3f9d6a1 /media | |
parent | 9944ff09ac4eb076cab994ef245b0103f60836ba (diff) | |
parent | 36617c67a9c29d7f9798972b6514086b22b731f8 (diff) | |
download | frameworks_av-9c5578c1a3bb00623d6ee99340ce0ce290e6c5a1.zip frameworks_av-9c5578c1a3bb00623d6ee99340ce0ce290e6c5a1.tar.gz frameworks_av-9c5578c1a3bb00623d6ee99340ce0ce290e6c5a1.tar.bz2 |
am 36617c67: am 7374360f: am 4e44b2ee: am 4534ec1a: am 4a5fbf74: am 3cc11bfc: Fix several ineffective integer overflow checks
* commit '36617c67a9c29d7f9798972b6514086b22b731f8':
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 8dfa365..1358582 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; } |