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

Commit faf128c9 authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge "Don't allow using or allocating a buffer after the first state...

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

Change-Id: Ic4de546269b2eb85f79f25900705999a7a5d24e6
parents f3bab7a1 b706fb9d
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;