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

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

OMXNodeInstance: sanity check portIndex. am: f80a1f50 am: 42f2e3d0

am: d6743b21

Change-Id: Ifc05bd88225a33d8bf40251d01f490ac5dde2a5b
parents 451ef03a d6743b21
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -531,6 +531,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);
@@ -1215,6 +1221,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);