Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dddf932f authored by Wei Jia's avatar Wei Jia Committed by Android Git Automerger
Browse files

am 41de4ba1: am cf69487d: am 6f80b09f: am 252a8c09: am 0f3ab16c: am af7e33f6:...

am 41de4ba1: am cf69487d: am 6f80b09f: am 252a8c09: am 0f3ab16c: am af7e33f6: libstagefright: check overflow before memory allocation in OMXCodec.cpp

* commit '41de4ba1':
  libstagefright: check overflow before memory allocation in OMXCodec.cpp
parents a6bafbc5 41de4ba1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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");