Commit 2d1a6016 authored by Lei Zhang's avatar Lei Zhang Committed by Alexandre Julliard

quartz: Validate input for IFilterGraph_FindFilterByName.

parent 31aab429
...@@ -483,7 +483,8 @@ static HRESULT WINAPI GraphBuilder_FindFilterByName(IGraphBuilder *iface, ...@@ -483,7 +483,8 @@ static HRESULT WINAPI GraphBuilder_FindFilterByName(IGraphBuilder *iface,
TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_w(pName), pName, ppFilter); TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_w(pName), pName, ppFilter);
*ppFilter = NULL; if (!ppFilter)
return E_POINTER;
for (i = 0; i < This->nFilters; i++) for (i = 0; i < This->nFilters; i++)
{ {
...@@ -495,6 +496,7 @@ static HRESULT WINAPI GraphBuilder_FindFilterByName(IGraphBuilder *iface, ...@@ -495,6 +496,7 @@ static HRESULT WINAPI GraphBuilder_FindFilterByName(IGraphBuilder *iface,
} }
} }
*ppFilter = NULL;
return VFW_E_NOT_FOUND; return VFW_E_NOT_FOUND;
} }
......
...@@ -143,6 +143,8 @@ static void test_graph_builder(void) ...@@ -143,6 +143,8 @@ static void test_graph_builder(void)
hr = IGraphBuilder_FindFilterByName(pgraph, testFilterW, &pF2); hr = IGraphBuilder_FindFilterByName(pgraph, testFilterW, &pF2);
ok(hr == S_OK, "IGraphBuilder_FindFilterByName returned %x\n", hr); ok(hr == S_OK, "IGraphBuilder_FindFilterByName returned %x\n", hr);
ok(pF2 != NULL, "IGraphBuilder_FindFilterByName returned NULL\n"); ok(pF2 != NULL, "IGraphBuilder_FindFilterByName returned NULL\n");
hr = IGraphBuilder_FindFilterByName(pgraph, testFilterW, NULL);
ok(hr == E_POINTER, "IGraphBuilder_FindFilterByName returned %x\n", hr);
releasefiltergraph(); releasefiltergraph();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment