Commit a3c65a32 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent f467ebad
......@@ -2678,9 +2678,11 @@ static void test_create_depthstencil_view(void)
hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture);
ok(SUCCEEDED(hr), "Test %u: Failed to create 2d texture, hr %#x.\n", i, hr);
dsview = (void *)0xdeadbeef;
get_dsv_desc(&dsv_desc, &invalid_desc_tests[i].dsv_desc);
hr = ID3D10Device_CreateDepthStencilView(device, (ID3D10Resource *)texture, &dsv_desc, &dsview);
ok(hr == E_INVALIDARG, "Test %u: Got unexpected hr %#x.\n", i, hr);
ok(!dsview, "Unexpected pointer %p.\n", dsview);
ID3D10Texture2D_Release(texture);
}
......
......@@ -3440,6 +3440,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDepthStencilView(ID3D11Devic
TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
*view = NULL;
if (FAILED(hr = d3d_depthstencil_view_create(device, resource, desc, &object)))
return hr;
......@@ -6103,6 +6105,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilView(ID3D10Devic
TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
*view = NULL;
if (desc)
{
d3d11_desc.Format = desc->Format;
......
......@@ -3788,9 +3788,11 @@ static void test_create_depthstencil_view(void)
hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture);
ok(SUCCEEDED(hr), "Test %u: Failed to create 2d texture, hr %#x.\n", i, hr);
dsview = (void *)0xdeadbeef;
get_dsv_desc(&dsv_desc, &invalid_desc_tests[i].dsv_desc);
hr = ID3D11Device_CreateDepthStencilView(device, (ID3D11Resource *)texture, &dsv_desc, &dsview);
ok(hr == E_INVALIDARG, "Test %u: Got unexpected hr %#x.\n", i, hr);
ok(!dsview, "Unexpected pointer %p.\n", dsview);
ID3D11Texture2D_Release(texture);
}
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