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

Commit fc7a3a56 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 am: ad0ec9b3

Change-Id: Ia83dfb602b091c512653eb83d7aa43b1c6e44cf2
parents 7ad36b07 ad0ec9b3
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);
}