Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d21fee12
Commit
d21fee12
authored
Jun 24, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mf: Avoid leaking nodes in IMFTopoLoader_Load.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
d7c3aac2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
18 deletions
+23
-18
mf.c
dlls/mf/tests/mf.c
+2
-11
topology.c
dlls/mf/topology.c
+21
-7
No files found.
dlls/mf/tests/mf.c
View file @
d21fee12
...
...
@@ -2175,9 +2175,8 @@ static void test_topology_loader(void)
/* Source node only. */
hr
=
IMFTopoLoader_Load
(
loader
,
topology
,
&
full_topology
,
NULL
);
todo_wine_if
(
hr
==
S_OK
)
todo_wine_if
(
hr
==
E_INVALIDARG
)
ok
(
hr
==
MF_E_TOPO_UNSUPPORTED
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
hr
==
S_OK
)
IMFTopology_Release
(
full_topology
);
hr
=
MFCreateTopologyNode
(
MF_TOPOLOGY_OUTPUT_NODE
,
&
sink_node
);
ok
(
hr
==
S_OK
,
"Failed to create output node, hr %#lx.
\n
"
,
hr
);
...
...
@@ -2388,28 +2387,23 @@ todo_wine {
ref
=
IMFTopoLoader_Release
(
loader
);
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
ref
=
IMFTopologyNode_Release
(
src_node
);
todo_wine
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
ref
=
IMFTopologyNode_Release
(
sink_node
);
todo_wine
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
ref
=
IMFMediaSource_Release
(
source
);
todo_wine
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
ref
=
IMFPresentationDescriptor_Release
(
pd
);
todo_wine
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
ref
=
IMFStreamDescriptor_Release
(
sd
);
todo_wine
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
ref
=
IMFMediaType_Release
(
input_type
);
todo_wine
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
/* FIXME: is native really leaking refs here, or are we? */
ref
=
IMFMediaType_Release
(
output_type
);
todo_wine
ok
(
ref
!=
0
,
"Release returned %ld
\n
"
,
ref
);
hr
=
MFShutdown
();
...
...
@@ -2542,10 +2536,8 @@ static void test_topology_loader_evr(void)
ref
=
IMFTopology_Release
(
topology
);
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
ref
=
IMFTopologyNode_Release
(
source_node
);
todo_wine
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
ref
=
IMFTopologyNode_Release
(
evr_node
);
todo_wine
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
hr
=
IMFActivate_ShutdownObject
(
activate
);
...
...
@@ -2556,7 +2548,6 @@ static void test_topology_loader_evr(void)
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
ref
=
IMFMediaType_Release
(
media_type
);
todo_wine
ok
(
ref
==
0
,
"Release returned %ld
\n
"
,
ref
);
DestroyWindow
(
window
);
...
...
dlls/mf/topology.c
View file @
d21fee12
...
...
@@ -2359,6 +2359,7 @@ static HRESULT topology_loader_resolve_branch(struct topoloader_context *context
};
MF_TOPOLOGY_TYPE
u_type
,
d_type
;
IMFTopologyNode
*
node
;
HRESULT
hr
;
TOPOID
id
;
/* Downstream node might have already been cloned. */
...
...
@@ -2372,10 +2373,13 @@ static HRESULT topology_loader_resolve_branch(struct topoloader_context *context
if
(
!
connectors
[
u_type
][
d_type
])
{
WARN
(
"Unsupported branch kind %d -> %d.
\n
"
,
u_type
,
d_type
);
IMFTopologyNode_Release
(
node
);
return
E_FAIL
;
}
return
connectors
[
u_type
][
d_type
](
context
,
upstream_node
,
output_index
,
node
,
input_index
);
hr
=
connectors
[
u_type
][
d_type
](
context
,
upstream_node
,
output_index
,
node
,
input_index
);
IMFTopologyNode_Release
(
node
);
return
hr
;
}
static
HRESULT
topology_loader_resolve_nodes
(
struct
topoloader_context
*
context
,
unsigned
int
*
layer_size
)
...
...
@@ -2391,19 +2395,25 @@ static HRESULT topology_loader_resolve_nodes(struct topoloader_context *context,
{
++
size
;
IMFTopology_GetNodeByID
(
context
->
input_topology
,
id
,
&
orig_node
);
IMFTopologyNode_GetNodeType
(
node
,
&
node_type
);
switch
(
node_type
)
{
case
MF_TOPOLOGY_SOURCESTREAM_NODE
:
if
(
FAILED
(
IMFTopologyNode_GetOutput
(
orig_node
,
0
,
&
downstream_node
,
&
input_index
)))
if
(
SUCCEEDED
(
hr
=
IMFTopology_GetNodeByID
(
context
->
input_topology
,
id
,
&
orig_node
)))
{
hr
=
IMFTopologyNode_GetOutput
(
orig_node
,
0
,
&
downstream_node
,
&
input_index
);
IMFTopologyNode_Release
(
orig_node
);
}
if
(
FAILED
(
hr
))
{
IMFTopology_RemoveNode
(
context
->
output_topology
,
node
);
IMFTopologyNode_Release
(
node
);
continue
;
}
hr
=
topology_loader_resolve_branch
(
context
,
node
,
0
,
downstream_node
,
input_index
);
IMFTopologyNode_Release
(
downstream_node
);
break
;
case
MF_TOPOLOGY_TRANSFORM_NODE
:
case
MF_TOPOLOGY_TEE_NODE
:
...
...
@@ -2414,6 +2424,7 @@ static HRESULT topology_loader_resolve_nodes(struct topoloader_context *context,
}
IMFTopologyNode_DeleteItem
(
node
,
&
context
->
key
);
IMFTopologyNode_Release
(
node
);
if
(
FAILED
(
hr
))
break
;
...
...
@@ -2661,10 +2672,13 @@ static HRESULT WINAPI topology_loader_Load(IMFTopoLoader *iface, IMFTopology *in
break
;
}
if
(
SUCCEEDED
(
hr
))
if
(
FAILED
(
hr
))
IMFTopology_Release
(
output_topology
);
else
{
topology_loader_resolve_complete
(
&
context
);
*
ret_topology
=
output_topology
;
*
ret_topology
=
output_topology
;
}
return
hr
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment