evr/presenter: Fix a crash when releasing partially initialized object.
This happens when presenter is unable to create d3d device. Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8c0c3d296f
commit
3c1a02eb97
|
@ -267,8 +267,11 @@ static void video_presenter_reset_media_type(struct video_presenter *presenter)
|
||||||
IMFMediaType_Release(presenter->media_type);
|
IMFMediaType_Release(presenter->media_type);
|
||||||
presenter->media_type = NULL;
|
presenter->media_type = NULL;
|
||||||
|
|
||||||
IMFVideoSampleAllocator_UninitializeSampleAllocator(presenter->allocator);
|
if (presenter->allocator)
|
||||||
video_presenter_set_allocator_callback(presenter, NULL);
|
{
|
||||||
|
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)
|
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;
|
goto failed;
|
||||||
|
|
||||||
if (FAILED(hr = video_presenter_init_d3d(object)))
|
if (FAILED(hr = video_presenter_init_d3d(object)))
|
||||||
|
{
|
||||||
|
WARN("Failed to initialize d3d device, hr %#x.\n", hr);
|
||||||
goto failed;
|
goto failed;
|
||||||
|
}
|
||||||
|
|
||||||
*out = &object->IUnknown_inner;
|
*out = &object->IUnknown_inner;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue