Gijs Vermeulen : amstream: Validate the format type in check_media_type().
Alexandre Julliard
julliard at winehq.org
Wed Jul 1 15:22:48 CDT 2020
Module: wine
Branch: master
Commit: fddae90d9b147b54a5edc8657e5f991cc26d8fbb
URL: https://source.winehq.org/git/wine.git/?a=commit;h=fddae90d9b147b54a5edc8657e5f991cc26d8fbb
Author: Gijs Vermeulen <gijsvrm at gmail.com>
Date: Tue Jun 30 19:57:16 2020 -0500
amstream: Validate the format type in check_media_type().
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/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 bcb752e6bd..9fcb6d37ce 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 a9a9ccfed0..1fa1f2432c 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;
More information about the wine-cvs
mailing list