Commit 576395c7 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

d3d11: Check parameter in ID3D11Device CreateShaderResourceView.

parent b70821a7
......@@ -2186,6 +2186,9 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateShaderResourceView(ID3D11Dev
TRACE("iface %p, resource %p, desc %p, view %p.\n", iface, resource, desc, view);
if (!resource)
return E_INVALIDARG;
if (FAILED(hr = d3d_shader_resource_view_create(device, resource, desc, &object)))
return hr;
......
......@@ -3283,6 +3283,9 @@ static void test_create_shader_resource_view(void)
U(srv_desc).Buffer.ElementOffset = 0;
U(srv_desc).Buffer.ElementWidth = 64;
hr = ID3D11Device_CreateShaderResourceView(device, NULL, &srv_desc, &srview);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
expected_refcount = get_refcount((IUnknown *)device) + 1;
hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)buffer, &srv_desc, &srview);
ok(SUCCEEDED(hr), "Failed to create a shader resource view, hr %#x.\n", hr);
......
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