diff options
author | Wei Jia <wjia@google.com> | 2015-06-03 16:47:19 -0700 |
---|---|---|
committer | Wei Jia <wjia@google.com> | 2015-06-04 09:56:22 -0700 |
commit | 2177f21c1ae5bf5cb8c1113a1adbe1fd7db34206 (patch) | |
tree | 7f3e94e92258fdb5e37f9416c40d533636d8d0eb /media/libstagefright/MPEG4Writer.cpp | |
parent | 9cf332ca156132931da397bae94b89debb40de10 (diff) | |
download | frameworks_av-2177f21c1ae5bf5cb8c1113a1adbe1fd7db34206.zip frameworks_av-2177f21c1ae5bf5cb8c1113a1adbe1fd7db34206.tar.gz frameworks_av-2177f21c1ae5bf5cb8c1113a1adbe1fd7db34206.tar.bz2 |
MPEG4Writer: add check to ensure no integer overflow on allocation.
Bug: 20674584
Change-Id: I77ef1891abf0a20994840a87fa99e55a62f40a70
Diffstat (limited to 'media/libstagefright/MPEG4Writer.cpp')
-rw-r--r-- | media/libstagefright/MPEG4Writer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/media/libstagefright/MPEG4Writer.cpp b/media/libstagefright/MPEG4Writer.cpp index 95f361e..99dc543 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. |