From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com --- libs/vkd3d/device.c | 3 +++ tests/d3d12.c | 3 +++ 2 files changed, 6 insertions(+)
diff --git a/libs/vkd3d/device.c b/libs/vkd3d/device.c index e8bf7c957b58..d39eef2c2499 100644 --- a/libs/vkd3d/device.c +++ b/libs/vkd3d/device.c @@ -1946,7 +1946,10 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateHeap(ID3D12Device *iface, iface, desc, debugstr_guid(iid), heap);
if (FAILED(hr = d3d12_heap_create(device, desc, &object))) + { + *heap = NULL; return hr; + }
return return_interface(&object->ID3D12Heap_iface, &IID_ID3D12Heap, iid, heap); } diff --git a/tests/d3d12.c b/tests/d3d12.c index 5a39f0c1dfa1..221157faa53f 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -1854,9 +1854,12 @@ static void test_create_heap(void) desc.Flags = D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES | D3D12_HEAP_FLAG_ALLOW_DISPLAY; hr = ID3D12Device_CreateHeap(device, &desc, &IID_ID3D12Heap, (void **)&heap); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + heap = (void *)0xdeadbeef; desc.Flags = D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES | D3D12_HEAP_FLAG_ALLOW_DISPLAY; hr = ID3D12Device_CreateHeap(device, &desc, &IID_ID3D12Heap, (void **)&heap); ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(!heap, "Got unexpected pointer %p.\n", heap);
for (i = 0; i < ARRAY_SIZE(tests); ++i) {