OMXNodeInstance: use a lock around OMX::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
diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp
index 00b3c7b..34ecb22 100644
--- a/media/libstagefright/omx/OMXNodeInstance.cpp
+++ b/media/libstagefright/omx/OMXNodeInstance.cpp
@@ -488,6 +488,9 @@
LOG_ALWAYS_FATAL("unknown state %s(%#x).", asString(state), state);
break;
}
+
+ Mutex::Autolock _l(mLock);
+
status_t err = mOwner->freeNode(this);
mDispatcher.clear();