Zhiyi Zhang : mf: Make session_get_node_object() more robust.
Module: wine Branch: master Commit: a00b30bfbf499679cb5fc356e5fdb7f9c4334dfb URL: https://gitlab.winehq.org/wine/wine/-/commit/a00b30bfbf499679cb5fc356e5fdb7f... Author: Zhiyi Zhang <zzhang(a)codeweavers.com> Date: Mon Aug 7 17:30:05 2023 +0800 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(a)codeweavers.com> --- dlls/mf/session.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/mf/session.c b/dlls/mf/session.c index db742350161..d06002481c4 100644 --- a/dlls/mf/session.c +++ b/dlls/mf/session.c @@ -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,
participants (1)
-
Alexandre Julliard