summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJoshua J. Drake <android-open-source@qoop.org>2015-08-04 02:55:56 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-04 02:55:56 +0000
commit4e44b2ee286bd993210aa81ad20ebbf1d1a816c6 (patch)
treedb1b5bb94de9e873dad8e718249fed3300eb928c /media
parentd0f9dc7156e531d5cd0615f6e682d2449e08e9a7 (diff)
parent4534ec1a552c125ef7eea0990a84fcefb58335b9 (diff)
downloadframeworks_av-4e44b2ee286bd993210aa81ad20ebbf1d1a816c6.zip
frameworks_av-4e44b2ee286bd993210aa81ad20ebbf1d1a816c6.tar.gz
frameworks_av-4e44b2ee286bd993210aa81ad20ebbf1d1a816c6.tar.bz2
am 4534ec1a: am 4a5fbf74: am 3cc11bfc: Fix several ineffective integer overflow checks
* commit '4534ec1a552c125ef7eea0990a84fcefb58335b9': Fix several ineffective integer overflow checks
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/SampleTable.cpp6
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;
}