Gijs Vermeulen : qcap/capturegraph: Return E_POINTER when ICaptureGraphBuilder2::FindInterface() is called with NULL filter.
Alexandre Julliard
julliard at winehq.org
Thu Oct 22 15:27:32 CDT 2020
Module: wine
Branch: master
Commit: 4aabbaaf95444c0b88978128a25a65e4ecf12743
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4aabbaaf95444c0b88978128a25a65e4ecf12743
Author: Gijs Vermeulen <gijsvrm at gmail.com>
Date: Thu Oct 22 18:14:56 2020 +0200
qcap/capturegraph: Return E_POINTER when ICaptureGraphBuilder2::FindInterface() is called with NULL filter.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46950
Signed-off-by: Gijs Vermeulen <gijsvrm at gmail.com>
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/qcap/capturegraph.c | 3 +++
dlls/qcap/tests/capturegraph.c | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/dlls/qcap/capturegraph.c b/dlls/qcap/capturegraph.c
index b4f83956f0e..b98a321cb3a 100644
--- a/dlls/qcap/capturegraph.c
+++ b/dlls/qcap/capturegraph.c
@@ -343,6 +343,9 @@ static HRESULT WINAPI fnCaptureGraphBuilder2_FindInterface(ICaptureGraphBuilder2
TRACE("graph %p, category %s, majortype %s, filter %p, iid %s, out %p.\n",
graph, debugstr_guid(category), debugstr_guid(majortype), filter, debugstr_guid(iid), out);
+ if (!filter)
+ return E_POINTER;
+
if (category && IsEqualGUID(category, &LOOK_DOWNSTREAM_ONLY))
return find_interface_recurse(PINDIR_OUTPUT, NULL, NULL, filter, iid, out);
diff --git a/dlls/qcap/tests/capturegraph.c b/dlls/qcap/tests/capturegraph.c
index c37ac515734..cdd9a27828a 100644
--- a/dlls/qcap/tests/capturegraph.c
+++ b/dlls/qcap/tests/capturegraph.c
@@ -384,6 +384,10 @@ static void test_find_interface(void)
/* Test search order without any restrictions applied. */
+ hr = ICaptureGraphBuilder2_FindInterface(capture_graph, NULL, &bogus_majortype,
+ NULL, &testiid, (void **)&unk);
+ ok(hr == E_POINTER, "got hr %#x.\n", hr);
+
for (i = 0; i < ARRAY_SIZE(tests_from_filter2); ++i)
{
hr = ICaptureGraphBuilder2_FindInterface(capture_graph, NULL, &bogus_majortype,
More information about the wine-cvs
mailing list