amstream: Validate the format type in check_media_type().

Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gijs Vermeulen 2020-06-30 19:57:16 -05:00 committed by Alexandre Julliard
parent 83bdfb780c
commit fddae90d9b
2 changed files with 3 additions and 3 deletions

View File

@ -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) 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) || if (IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB1) ||
IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB4) || IsEqualGUID(&media_type->subtype, &MEDIASUBTYPE_RGB4) ||

View File

@ -1946,8 +1946,7 @@ static void test_media_types(void)
pmt->cbFormat = tests[i].size; pmt->cbFormat = tests[i].size;
pmt->pbFormat = tests[i].format; pmt->pbFormat = tests[i].format;
hr = IPin_QueryAccept(pin, pmt); 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; pmt->bFixedSizeSamples = FALSE;