d3d11: Always initialize out view pointer in CreateRenderTargetView().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51195
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit df8ef3a54f)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Nikolay Sivov 2022-01-08 16:03:08 +03:00 committed by Michael Stefaniuc
parent c03499e8ec
commit 3ce2336788
3 changed files with 12 additions and 0 deletions

View File

@ -2937,8 +2937,10 @@ static void test_create_rendertarget_view(void)
if (!enable_debug_layer)
{
rtview = (void *)0xdeadbeef;
hr = ID3D10Device_CreateRenderTargetView(device, NULL, &rtv_desc, &rtview);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
ok(!rtview, "Unexpected pointer %p.\n", rtview);
}
expected_refcount = get_refcount(device) + 1;
@ -3055,8 +3057,10 @@ static void test_create_rendertarget_view(void)
}
get_rtv_desc(&rtv_desc, &invalid_desc_tests[i].rtv_desc);
rtview = (void *)0xdeadbeef;
hr = ID3D10Device_CreateRenderTargetView(device, texture, &rtv_desc, &rtview);
ok(hr == E_INVALIDARG, "Test %u: Got unexpected hr %#x.\n", i, hr);
ok(!rtview, "Unexpected pointer %p.\n", rtview);
ID3D10Resource_Release(texture);
}

View File

@ -3054,6 +3054,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateRenderTargetView(ID3D11Devic
TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
*view = NULL;
if (!resource)
return E_INVALIDARG;
@ -5554,6 +5556,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Devic
TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
*view = NULL;
if (!resource)
return E_INVALIDARG;

View File

@ -3936,8 +3936,10 @@ static void test_create_rendertarget_view(void)
if (!enable_debug_layer)
{
rtview = (void *)0xdeadbeef;
hr = ID3D11Device_CreateRenderTargetView(device, NULL, &rtv_desc, &rtview);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
ok(!rtview, "Unexpected pointer %p.\n", rtview);
}
expected_refcount = get_refcount(device) + 1;
@ -4054,8 +4056,10 @@ static void test_create_rendertarget_view(void)
}
get_rtv_desc(&rtv_desc, &invalid_desc_tests[i].rtv_desc);
rtview = (void *)0xdeadbeef;
hr = ID3D11Device_CreateRenderTargetView(device, texture, &rtv_desc, &rtview);
ok(hr == E_INVALIDARG, "Test %u: Got unexpected hr %#x.\n", i, hr);
ok(!rtview, "Unexpected pointer %p.\n", rtview);
ID3D11Resource_Release(texture);
}