Module: wine Branch: master Commit: 2d1a6016c9b18fabeb38a6dbe2fcfe82847706d1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2d1a6016c9b18fabeb38a6dbe2...
Author: Lei Zhang thestig@google.com Date: Wed Dec 5 20:11:33 2007 -0800
quartz: Validate input for IFilterGraph_FindFilterByName.
---
dlls/quartz/filtergraph.c | 4 +++- dlls/quartz/tests/filtergraph.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index e583cee..eb6321b 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -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; }
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 85cce7c..4a29edb 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -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(); }