Nikolay Sivov : evr/mixer: Fix error handling in output types collection helper.
Alexandre Julliard
julliard at winehq.org
Fri Sep 18 15:52:50 CDT 2020
Module: wine
Branch: master
Commit: 305aaec8773a7cbd0fdd4d12c5e0210e9cb5f33d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=305aaec8773a7cbd0fdd4d12c5e0210e9cb5f33d
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Fri Sep 18 17:25:16 2020 +0300
evr/mixer: Fix error handling in output types collection helper.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/evr/mixer.c | 6 +++++-
dlls/evr/tests/evr.c | 1 -
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/evr/mixer.c b/dlls/evr/mixer.c
index 710e20815a..e19520fa7e 100644
--- a/dlls/evr/mixer.c
+++ b/dlls/evr/mixer.c
@@ -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)
diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c
index 3e2675497a..bf33051d6e 100644
--- a/dlls/evr/tests/evr.c
+++ b/dlls/evr/tests/evr.c
@@ -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);
More information about the wine-cvs
mailing list