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

Commit 3294a9fe authored by Marco Nelissen's avatar Marco Nelissen Committed by Android (Google) Code Review
Browse files

Merge "Don't allow using or allocating a buffer after the first state transition" into nyc-dev

parents c9f14c34 e2532045
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -792,6 +792,12 @@ status_t OMXNodeInstance::useBuffer(
        return BAD_VALUE;
    }

    if (!mSailed) {
        ALOGE("b/35467458");
        android_errorWriteLog(0x534e4554, "35467458");
        return BAD_VALUE;
    }

    // metadata buffers are not connected cross process
    // use a backup buffer instead of the actual buffer
    BufferMeta *buffer_meta;
@@ -1223,6 +1229,12 @@ status_t OMXNodeInstance::allocateSecureBuffer(

    Mutex::Autolock autoLock(mLock);

    if (!mSailed) {
        ALOGE("b/35467458");
        android_errorWriteLog(0x534e4554, "35467458");
        return BAD_VALUE;
    }

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

    OMX_BUFFERHEADERTYPE *header;
@@ -1278,6 +1290,12 @@ status_t OMXNodeInstance::allocateBufferWithBackup(
        return BAD_VALUE;
    }

    if (!mSailed) {
        ALOGE("b/35467458");
        android_errorWriteLog(0x534e4554, "35467458");
        return BAD_VALUE;
    }

    // metadata buffers are not connected cross process; only copy if not meta
    bool copy = mMetadataType[portIndex] == kMetadataBufferTypeInvalid;