evr/mixer: Fix error handling in output types collection helper.

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-18 17:25:16 +03:00 committed by Alexandre Julliard
parent 97136a8707
commit 305aaec877
2 changed files with 5 additions and 2 deletions

View File

@ -604,6 +604,7 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
if (!(ptr = heap_realloc(rt_formats, (count + format_count) * sizeof(*rt_formats))))
{
hr = E_OUTOFMEMORY;
count = 0;
CoTaskMemFree(formats);
break;
}
@ -641,12 +642,15 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
mixer->output.type_count = count;
}
else
{
hr = E_OUTOFMEMORY;
count = 0;
}
}
heap_free(rt_formats);
return hr;
return count ? S_OK : hr;
}
static HRESULT WINAPI video_mixer_transform_SetInputType(IMFTransform *iface, DWORD id, IMFMediaType *media_type, DWORD flags)

View File

@ -893,7 +893,6 @@ static void test_default_mixer_type_negotiation(void)
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_SetInputType(transform, 0, (IMFMediaType *)video_type, 0);
todo_wine
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFTransform_GetInputCurrentType(transform, 0, &media_type);