From d918c6a482a9d9558a1d69d4d8adb9a8c85b12c6 Mon Sep 17 00:00:00 2001 From: Gijs Vermeulen Date: Mon, 23 Nov 2020 17:29:26 +0100 Subject: [PATCH] quartz: Return VFW_E_ENUM_OUT_OF_SYNC in IEnumFilters::Skip() when enum version doesn't match graph version. Signed-off-by: Gijs Vermeulen Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/quartz/filtergraph.c | 3 +++ dlls/quartz/tests/filtergraph.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index fb0890fda1f..beceaa8b6b3 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -322,6 +322,9 @@ static HRESULT WINAPI EnumFilters_Skip(IEnumFilters *iface, ULONG count) TRACE("enum_filters %p, count %u.\n", enum_filters, count); + if (enum_filters->version != enum_filters->graph->version) + return VFW_E_ENUM_OUT_OF_SYNC; + if (!enum_filters->cursor) return S_FALSE; diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index b6e68f3f6b9..353e3b2e33e 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -683,6 +683,9 @@ static void test_enum_filters(void) hr = IEnumFilters_Next(enum1, 1, filters, NULL); ok(hr == VFW_E_ENUM_OUT_OF_SYNC, "Got hr %#x.\n", hr); + hr = IEnumFilters_Skip(enum1, 1); + ok(hr == VFW_E_ENUM_OUT_OF_SYNC, "Got hr %#x.\n", hr); + hr = IEnumFilters_Reset(enum1); ok(hr == S_OK, "Got hr %#x.\n", hr);