diff options
author | Wei Jia <wjia@google.com> | 2015-08-04 16:40:31 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-04 16:40:31 +0000 |
commit | a99d3d8327d60c8f8ef3e34fc4b81ef382e9e6d2 (patch) | |
tree | c6262e78e028580b2c93b40e76e69fbdc54e6918 /media | |
parent | 8ef5da3ddddd1bb4356d9cc6df4d52ad8afc4459 (diff) | |
parent | 738a753a3ca7bf8f9f608ca941575626265294e4 (diff) | |
download | frameworks_av-a99d3d8327d60c8f8ef3e34fc4b81ef382e9e6d2.zip frameworks_av-a99d3d8327d60c8f8ef3e34fc4b81ef382e9e6d2.tar.gz frameworks_av-a99d3d8327d60c8f8ef3e34fc4b81ef382e9e6d2.tar.bz2 |
am 738a753a: SampleTable: fix integer overflow checks.
* commit '738a753a3ca7bf8f9f608ca941575626265294e4':
SampleTable: fix integer overflow checks.
Diffstat (limited to 'media')
-rw-r--r-- | media/libstagefright/SampleTable.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/media/libstagefright/SampleTable.cpp b/media/libstagefright/SampleTable.cpp index a7ceecb..52ce82b 100644 --- a/media/libstagefright/SampleTable.cpp +++ b/media/libstagefright/SampleTable.cpp @@ -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; } |