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

Commit 2d4e2b49 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 am: 12c17606 am: 8671302d
am: 4a920030

Change-Id: I1534efa8ced51e1b43611da84283d67af1d4f8bd
parents cbdc2b78 4a920030
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);