mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d: Set pointer to NULL if heap creation fails.
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
150d1f0eb8
commit
605cb12eca
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user