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 db99ef2..0a3575d 100644
--- a/media/libstagefright/omx/OMXNodeInstance.cpp
+++ b/media/libstagefright/omx/OMXNodeInstance.cpp
@@ -486,6 +486,9 @@
LOG_ALWAYS_FATAL("unknown state %s(%#x).", asString(state), state);
break;
}
+
+ Mutex::Autolock _l(mLock);
+
status_t err = mOwner->freeNode(this);
mDispatcher.clear();