Commit 3c1a02eb authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

evr/presenter: Fix a crash when releasing partially initialized object.

This happens when presenter is unable to create d3d device. Signed-off-by: 's avatarNikolay Sivov <nsivov@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 8c0c3d29
......@@ -267,8 +267,11 @@ static void video_presenter_reset_media_type(struct video_presenter *presenter)
IMFMediaType_Release(presenter->media_type);
presenter->media_type = NULL;
IMFVideoSampleAllocator_UninitializeSampleAllocator(presenter->allocator);
video_presenter_set_allocator_callback(presenter, NULL);
if (presenter->allocator)
{
IMFVideoSampleAllocator_UninitializeSampleAllocator(presenter->allocator);
video_presenter_set_allocator_callback(presenter, NULL);
}
}
static HRESULT video_presenter_set_media_type(struct video_presenter *presenter, IMFMediaType *media_type)
......@@ -2083,7 +2086,10 @@ HRESULT evr_presenter_create(IUnknown *outer, void **out)
goto failed;
if (FAILED(hr = video_presenter_init_d3d(object)))
{
WARN("Failed to initialize d3d device, hr %#x.\n", hr);
goto failed;
}
*out = &object->IUnknown_inner;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment