mf: Make session_get_node_object() more robust.
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. Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
This commit is contained in:
parent
06482e324c
commit
a00b30bfbf
1 changed files with 2 additions and 2 deletions
|
@ -2851,10 +2851,10 @@ static struct topo_node *session_get_node_object(struct media_session *session,
|
|||
LIST_FOR_EACH_ENTRY(node, &session->presentation.nodes, struct topo_node, entry)
|
||||
{
|
||||
if (node->type == node_type && object == node->object.object)
|
||||
break;
|
||||
return node;
|
||||
}
|
||||
|
||||
return node;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static BOOL session_set_node_object_state(struct media_session *session, IUnknown *object,
|
||||
|
|
Loading…
Add table
Reference in a new issue