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

Commit ad0ec9b3 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role)
Browse files

[automerger] Fix a race condition in OMXNodeInstance am: fe3708f7 am: dce12d18

Change-Id: I8aa8cb36c18fea386753f1f5160f7b7499358cac
parents 1d382c6b dce12d18
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1249,12 +1249,15 @@ status_t OMXNodeInstance::freeBuffer(
    }
    BufferMeta *buffer_meta = static_cast<BufferMeta *>(header->pAppPrivate);

    // Invalidate buffers in the client side first before calling OMX_FreeBuffer.
    // If not, pending events in the client side might access the buffers after free.
    invalidateBufferID(buffer);

    OMX_ERRORTYPE err = OMX_FreeBuffer(mHandle, portIndex, header);
    CLOG_IF_ERROR(freeBuffer, err, "%s:%u %#x", portString(portIndex), portIndex, buffer);

    delete buffer_meta;
    buffer_meta = NULL;
    invalidateBufferID(buffer);

    return StatusFromOMXError(err);
}