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

Commit 12c17606 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 klp-dev am: 922ad618 am: 0893c50b am: 59bc7f77 am: 82ffcbd6 am: 9edaa79f
am: 56c520c4

Change-Id: I27e648ddd65325600cad22d5b0fef03aa4a9447a
parents 241f5feb 56c520c4
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -769,6 +769,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
    BufferMeta *buffer_meta;
    bool isMeta = mMetadataType[portIndex] != kMetadataBufferTypeInvalid;
@@ -1112,6 +1118,12 @@ status_t OMXNodeInstance::allocateBuffer(
        void **buffer_data) {
    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;
@@ -1153,6 +1165,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
    bool isMeta = mMetadataType[portIndex] != kMetadataBufferTypeInvalid;
    bool copy = !(crossProcess && isMeta);