From fddae90d9b147b54a5edc8657e5f991cc26d8fbb Mon Sep 17 00:00:00 2001 From: Gijs Vermeulen Date: Tue, 30 Jun 2020 19:57:16 -0500 Subject: [PATCH] amstream: Validate the format type in check_media_type(). Signed-off-by: Gijs Vermeulen Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/amstream/ddrawstream.c | 3 ++- dlls/amstream/tests/amstream.c | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/amstream/ddrawstream.c b/dlls/amstream/ddrawstream.c index bcb752e6bdf..9fcb6d37cee 100644 --- a/dlls/amstream/ddrawstream.c +++ b/dlls/amstream/ddrawstream.c @@ -634,7 +634,8 @@ static HRESULT WINAPI ddraw_sink_Connect(IPin *iface, IPin *peer, const AM_MEDIA static BOOL check_media_type(const AM_MEDIA_TYPE *media_type) { - if (IsEqualGUID(&media_type->majortype, &MEDIATYPE_Video)) + 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) || diff --git a/dlls/amstream/tests/amstream.c b/dlls/amstream/tests/amstream.c index a9a9ccfed09..1fa1f2432c5 100644 --- a/dlls/amstream/tests/amstream.c +++ b/dlls/amstream/tests/amstream.c @@ -1946,8 +1946,7 @@ static void test_media_types(void) pmt->cbFormat = tests[i].size; pmt->pbFormat = tests[i].format; hr = IPin_QueryAccept(pin, pmt); - todo_wine_if (i != 6) - ok(hr == (i == 6) ? S_OK : VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); + ok(hr == (i == 6) ? S_OK : VFW_E_TYPE_NOT_ACCEPTED, "Got hr %#x.\n", hr); } pmt->bFixedSizeSamples = FALSE;