summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2015-04-10 01:18:49 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-10 01:18:50 +0000
commit199f0e5dbdc75fb85df13be4fa9d83d31e2ece43 (patch)
tree66966e4447e66d82bd9ab64518ba580afb060dc5 /media
parent98336a769a3a54070c73fa44d7d776a407b55458 (diff)
parente2e812e58e8d2716b00d7d82db99b08d3afb4b32 (diff)
downloadframeworks_av-199f0e5dbdc75fb85df13be4fa9d83d31e2ece43.zip
frameworks_av-199f0e5dbdc75fb85df13be4fa9d83d31e2ece43.tar.gz
frameworks_av-199f0e5dbdc75fb85df13be4fa9d83d31e2ece43.tar.bz2
Merge "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 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;
}