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

Commit 56c520c4 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

Change-Id: Iad06395ed255dbd48b0a77147b6da809963e4306
parents 4d86bef7 9edaa79f
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -740,6 +740,12 @@ status_t OMXNodeInstance::useBuffer(
    // We do not support metadata mode changes past buffer allocation
    mSailed = true;

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

    // metadata buffers are not connected cross process
    BufferMeta *buffer_meta;
    bool isMeta = mUsingMetadata[portIndex];
@@ -1006,6 +1012,12 @@ status_t OMXNodeInstance::allocateBuffer(
    // We do not support metadata mode changes past buffer allocation
    mSailed = true;

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

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

    OMX_BUFFERHEADERTYPE *header;
@@ -1049,6 +1061,12 @@ status_t OMXNodeInstance::allocateBufferWithBackup(
    // We do not support metadata mode changes past buffer allocation
    mSailed = true;

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

    // metadata buffers are not connected cross process
    bool isMeta = mUsingMetadata[portIndex];
    bool copy = !(crossProcess && isMeta);