evr/mixer: Handle uninitialized input case in GetOutputAvailableType().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-09-17 14:24:38 +03:00 committed by Alexandre Julliard
parent 19342f43bb
commit deac29d411
2 changed files with 6 additions and 1 deletions

View File

@ -533,7 +533,9 @@ static HRESULT WINAPI video_mixer_transform_GetOutputAvailableType(IMFTransform
EnterCriticalSection(&mixer->cs);
if (index >= mixer->output.type_count)
if (!mixer->inputs[0].media_type)
hr = MF_E_TRANSFORM_TYPE_NOT_SET;
else if (index >= mixer->output.type_count)
hr = MF_E_NO_MORE_TYPES;
else
{

View File

@ -835,6 +835,9 @@ static void test_default_mixer_type_negotiation(void)
hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type);
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetOutputAvailableType(transform, 0, 0, &media_type);
ok(hr == MF_E_TRANSFORM_TYPE_NOT_SET, "Unexpected hr %#x.\n", hr);
hr = MFCreateMediaType(&media_type);
ok(hr == S_OK, "Failed to create media type, hr %#x.\n", hr);