vkd3d: Clear the output pointer on failure in vkd3d_create_versioned_root_signature_deserializer().

This commit is contained in:
Conor McCarthy 2024-06-17 17:07:32 +10:00 committed by Henri Verbeet
parent ae4a6c7044
commit 91475c684f
Notes: Henri Verbeet 2024-09-24 14:10:08 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1105
2 changed files with 4 additions and 3 deletions

View File

@ -415,6 +415,7 @@ HRESULT vkd3d_create_versioned_root_signature_deserializer(const void *data, SIZ
if (FAILED(hr = d3d12_versioned_root_signature_deserializer_init(object, &dxbc)))
{
vkd3d_free(object);
*deserializer = NULL;
return hr;
}

View File

@ -13152,20 +13152,20 @@ static void test_root_signature_byte_code(void)
hr = pfn_D3D12CreateVersionedRootSignatureDeserializer(empty_rootsig, 0,
&IID_ID3D12VersionedRootSignatureDeserializer, (void **)&versioned_deserializer);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
todo ok(!versioned_deserializer, "Got unexpected versioned_deserializer %p.\n", versioned_deserializer);
ok(!versioned_deserializer, "Got unexpected versioned_deserializer %p.\n", versioned_deserializer);
versioned_deserializer = (ID3D12VersionedRootSignatureDeserializer *)0xdeadbeef;
hr = pfn_D3D12CreateVersionedRootSignatureDeserializer(NULL, 0,
&IID_ID3D12VersionedRootSignatureDeserializer, (void **)&versioned_deserializer);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
todo ok(!versioned_deserializer, "Got unexpected versioned_deserializer %p.\n", versioned_deserializer);
ok(!versioned_deserializer, "Got unexpected versioned_deserializer %p.\n", versioned_deserializer);
versioned_deserializer = (ID3D12VersionedRootSignatureDeserializer *)0xdeadbeef;
i = 0xdeadbeef;
hr = pfn_D3D12CreateVersionedRootSignatureDeserializer(&i, sizeof(i),
&IID_ID3D12VersionedRootSignatureDeserializer, (void **)&versioned_deserializer);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
todo ok(!versioned_deserializer, "Got unexpected versioned_deserializer %p.\n", versioned_deserializer);
ok(!versioned_deserializer, "Got unexpected versioned_deserializer %p.\n", versioned_deserializer);
hr = pfn_D3D12CreateVersionedRootSignatureDeserializer(empty_rootsig, sizeof(empty_rootsig),
&IID_ID3D12VersionedRootSignatureDeserializer, (void **)&versioned_deserializer);