quartz: Validate input for IFilterGraph_FindFilterByName.

This commit is contained in:
Lei Zhang 2007-12-05 20:11:33 -08:00 committed by Alexandre Julliard
parent 31aab42934
commit 2d1a6016c9
2 changed files with 5 additions and 1 deletions

View File

@ -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);
*ppFilter = NULL;
if (!ppFilter)
return E_POINTER;
for (i = 0; i < This->nFilters; i++)
{
@ -495,6 +496,7 @@ static HRESULT WINAPI GraphBuilder_FindFilterByName(IGraphBuilder *iface,
}
}
*ppFilter = NULL;
return VFW_E_NOT_FOUND;
}

View File

@ -143,6 +143,8 @@ static void test_graph_builder(void)
hr = IGraphBuilder_FindFilterByName(pgraph, testFilterW, &pF2);
ok(hr == S_OK, "IGraphBuilder_FindFilterByName returned %x\n", hr);
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();
}