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

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

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

Change-Id: I6b438d3fd0cdbf8d4f85a7e2c053be1c5cbd5e82
parents 9c577404 fe3708f7
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);
}