summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MPEG4Writer.cpp
diff options
context:
space:
mode:
authorWei Jia <wjia@google.com>2015-06-08 22:15:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-08 22:15:17 +0000
commit0b305f2d8f328426f5c59b5d5f2707ffefe35a5c (patch)
tree520d6bb5c509dc9aea3e511b859060da0fc7279e /media/libstagefright/MPEG4Writer.cpp
parentd46a6b9fd8b2a4f9098757384711e2cd03a91651 (diff)
parent2177f21c1ae5bf5cb8c1113a1adbe1fd7db34206 (diff)
downloadframeworks_av-0b305f2d8f328426f5c59b5d5f2707ffefe35a5c.zip
frameworks_av-0b305f2d8f328426f5c59b5d5f2707ffefe35a5c.tar.gz
frameworks_av-0b305f2d8f328426f5c59b5d5f2707ffefe35a5c.tar.bz2
Merge "MPEG4Writer: add check to ensure no integer overflow on allocation." into mnc-dev
Diffstat (limited to 'media/libstagefright/MPEG4Writer.cpp')
-rw-r--r--media/libstagefright/MPEG4Writer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp
index 867ce0b..47f114a 100644
--- a/media/libstagefright/MPEG4Writer.cpp
+++ b/media/libstagefright/MPEG4Writer.cpp
@@ -113,6 +113,8 @@ private:
mCurrTableEntriesElement(NULL) {
CHECK_GT(mElementCapacity, 0);
CHECK_GT(mEntryCapacity, 0);
+ // Ensure no integer overflow on allocation in add().
+ CHECK_LT(mEntryCapacity, UINT32_MAX / mElementCapacity);
}
// Free the allocated memory.