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

Commit 975fa5b8 authored by Lajos Molnar's avatar Lajos Molnar
Browse files

OMXNodeInstance: use a lock in freeNode

This is to avoid a concurrent use after free if other OMX commands
are being executed before the node is marked as deleted.

Bug: 63666573
Change-Id: I7720dd900bfa252f8675e0c56191adbf52aa957e
parent 5b89f4af
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -343,6 +343,8 @@ status_t OMXNodeInstance::freeNode(OMXMaster *master) {
            break;
            break;
    }
    }


    Mutex::Autolock _l(mLock);

    ALOGV("[%x:%s] calling destroyComponentInstance", mNodeID, mName);
    ALOGV("[%x:%s] calling destroyComponentInstance", mNodeID, mName);
    OMX_ERRORTYPE err = master->destroyComponentInstance(
    OMX_ERRORTYPE err = master->destroyComponentInstance(
            static_cast<OMX_COMPONENTTYPE *>(mHandle));
            static_cast<OMX_COMPONENTTYPE *>(mHandle));