summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorWei Jia <wjia@google.com>2015-08-04 17:51:22 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-04 17:51:22 +0000
commit10ef7f7514bdf6d9c38c93d9bb0194c0920d152f (patch)
treebd225fdb0aae77f25c055bd2f6c1c162a29989af /media
parentcfc121128aef10a98e5ad9162f43e3f368abd103 (diff)
parentb0924c631cfccd10c1f95d6ae44c8cd852e14a9f (diff)
downloadframeworks_av-10ef7f7514bdf6d9c38c93d9bb0194c0920d152f.zip
frameworks_av-10ef7f7514bdf6d9c38c93d9bb0194c0920d152f.tar.gz
frameworks_av-10ef7f7514bdf6d9c38c93d9bb0194c0920d152f.tar.bz2
am b0924c63: am 7af634e1: am 8ec119d2: am d138024f: am b32957db: am a9d7c917: am a99d3d83: am 738a753a: SampleTable: fix integer overflow checks.
* commit 'b0924c631cfccd10c1f95d6ae44c8cd852e14a9f': SampleTable: fix integer overflow checks.
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/SampleTable.cpp4
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;
}