From: Zhiyi Zhang zzhang@codeweavers.com
It's possible that a state object pointer not in the topology node collection gets passed to session_get_node_object(). Instead of returning the last node when the object is not found, we should return a NULL so that the state of the last node is not changed by mistake. --- dlls/mf/session.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/mf/session.c b/dlls/mf/session.c index 555a71dcdf7..8fe3260e9f0 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -2809,15 +2809,20 @@ static HRESULT session_start_clock(struct media_session *session) static struct topo_node *session_get_node_object(struct media_session *session, IUnknown *object, MF_TOPOLOGY_TYPE node_type) { - struct topo_node *node = NULL; + struct topo_node *node = NULL, *found = NULL;
LIST_FOR_EACH_ENTRY(node, &session->presentation.nodes, struct topo_node, entry) { if (node->type == node_type && object == node->object.object) + { + found = node; break; + } }
- return node; + if (!found) + WARN("Failed to find object %p.\n", object); + return found; }
static BOOL session_set_node_object_state(struct media_session *session, IUnknown *object,