diff options
author | Wei Jia <wjia@google.com> | 2015-08-23 19:19:25 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-23 19:19:25 +0000 |
commit | 6f80b09f61da018d2f05e5303c0a798f9011d667 (patch) | |
tree | a1b910c81c02db8514744e8005d50449599602a4 | |
parent | 492bba08202a601e96a13b26422c85b3fb1a5ee0 (diff) | |
parent | 252a8c0956fe5a10bc18d9d4c6337edf29657d72 (diff) | |
download | frameworks_av-6f80b09f61da018d2f05e5303c0a798f9011d667.zip frameworks_av-6f80b09f61da018d2f05e5303c0a798f9011d667.tar.gz frameworks_av-6f80b09f61da018d2f05e5303c0a798f9011d667.tar.bz2 |
am 252a8c09: am 0f3ab16c: am af7e33f6: libstagefright: check overflow before memory allocation in OMXCodec.cpp
* commit '252a8c0956fe5a10bc18d9d4c6337edf29657d72':
libstagefright: check overflow before memory allocation in OMXCodec.cpp
-rw-r--r-- | media/libstagefright/OMXCodec.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp index a8806c8..3da0b7c 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -1648,6 +1648,9 @@ status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) { def.nBufferCountActual, def.nBufferSize, portIndex == kPortIndexInput ? "input" : "output"); + if (def.nBufferSize != 0 && def.nBufferCountActual > SIZE_MAX / def.nBufferSize) { + return BAD_VALUE; + } size_t totalSize = def.nBufferCountActual * def.nBufferSize; mDealer[portIndex] = new MemoryDealer(totalSize, "OMXCodec"); |