diff options
| -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 4d30069..f41bbc2 100644 --- a/media/libstagefright/OMXCodec.cpp +++ b/media/libstagefright/OMXCodec.cpp @@ -1654,6 +1654,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");  | 
