From: Zebediah Figura Subject: [PATCH v2 6/6] amstream: Accept only MEDIASUBTYPE_RGB8 in check_media_type(). Message-Id: <20200701005717.799537-6-z.figura12@gmail.com> Date: Tue, 30 Jun 2020 19:57:17 -0500 In-Reply-To: <20200701005717.799537-1-z.figura12@gmail.com> References: <20200701005717.799537-1-z.figura12@gmail.com> From: Gijs Vermeulen Signed-off-by: Gijs Vermeulen Signed-off-by: Zebediah Figura --- dlls/amstream/ddrawstream.c | 21 +++++---------------- dlls/amstream/tests/amstream.c | 5 ++--- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index 9fcb6d37cee..5530603f7aa 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -632,23 +632,12 @@ static HRESULT WINAPI ddraw_sink_Connect(IPin *iface, IPin *peer, const AM_MEDIA return E_UNEXPECTED; } -static BOOL check_media_type(const AM_MEDIA_TYPE *media_type) +static BOOL check_media_type(const AM_MEDIA_TYPE *mt) { - if (IsEqualGUID(&media_type->majortype, &MEDIATYPE_Video) - && IsEqualGUID(&media_type->formattype, &FORMAT_VideoInfo)) - { - if (IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB1) || - IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB4) || - IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB8) || - IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB565) || - IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB555) || - IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB24) || - IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB32)) - { - TRACE("Video sub-type %s matches\n", debugstr_guid(&media_type->subtype)); - return TRUE; - } - } + if (IsEqualGUID(&mt->majortype, &MEDIATYPE_Video) + && IsEqualGUID(&mt->subtype, &MEDIASUBTYPE_RGB8) + && IsEqualGUID(&mt->formattype, &FORMAT_VideoInfo)) + return TRUE; return FALSE; } diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index 1fa1f2432c5..bbad585d48a 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -1970,9 +1970,8 @@ static void test_media_types(void) { pmt->subtype = *rejected_subtypes[i]; hr = IPin_QueryAccept(pin, pmt); - todo_wine_if (i < 6) - ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x for subtype %s.\n", - hr, wine_dbgstr_guid(rejected_subtypes[i])); + ok(hr == VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x for subtype %s.\n", + hr, wine_dbgstr_guid(rejected_subtypes[i])); } CoTaskMemFree(pmt); -- 2.27.0