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

Commit fdef4bd6 authored by Wei Jia's avatar Wei Jia Committed by android-build-merger
Browse files

OMXNodeInstance: sanity check portIndex.

am: f80a1f50

Change-Id: I065e500d25a8699845ec00d79f4ff7237f345868
parents a2ae5920 f80a1f50
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -530,6 +530,12 @@ status_t OMXNodeInstance::getState(OMX_STATETYPE* state) {

status_t OMXNodeInstance::enableNativeBuffers(
        OMX_U32 portIndex, OMX_BOOL graphic, OMX_BOOL enable) {
    if (portIndex >= NELEM(mSecureBufferType)) {
        ALOGE("b/31385713, portIndex(%u)", portIndex);
        android_errorWriteLog(0x534e4554, "31385713");
        return BAD_VALUE;
    }

    Mutex::Autolock autoLock(mLock);
    CLOG_CONFIG(enableNativeBuffers, "%s:%u%s, %d", portString(portIndex), portIndex,
                graphic ? ", graphic" : "", enable);
@@ -1216,6 +1222,12 @@ status_t OMXNodeInstance::allocateSecureBuffer(
        return BAD_VALUE;
    }

    if (portIndex >= NELEM(mSecureBufferType)) {
        ALOGE("b/31385713, portIndex(%u)", portIndex);
        android_errorWriteLog(0x534e4554, "31385713");
        return BAD_VALUE;
    }

    Mutex::Autolock autoLock(mLock);

    BufferMeta *buffer_meta = new BufferMeta(size, portIndex);