diff options
| author | Wei Jia <wjia@google.com> | 2015-08-23 19:33:29 +0000 | 
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-23 19:33:29 +0000 | 
| commit | 41de4ba1d896c4e8ab7df24d10ca7d5109fbd323 (patch) | |
| tree | 2820d3d9bfdc72a048f8fe7949a4bbc844ee9d5d | |
| parent | 2c02f5eeec639825ece4acbca0d1969da192dca0 (diff) | |
| parent | cf69487d1af3eeba724b65716a63ae13238e6e4a (diff) | |
| download | frameworks_av-41de4ba1d896c4e8ab7df24d10ca7d5109fbd323.zip frameworks_av-41de4ba1d896c4e8ab7df24d10ca7d5109fbd323.tar.gz frameworks_av-41de4ba1d896c4e8ab7df24d10ca7d5109fbd323.tar.bz2  | |
am cf69487d: am 6f80b09f: am 252a8c09: am 0f3ab16c: am af7e33f6: libstagefright: check overflow before memory allocation in OMXCodec.cpp
* commit 'cf69487d1af3eeba724b65716a63ae13238e6e4a':
  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 6da00e6..6cb0775 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -1650,6 +1650,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");  | 
