mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
libs/vkd3d: Fix memory leak in d3d12_root_signature_init().
This commit is contained in:
parent
3328be8c87
commit
d39d0e4c9f
@ -311,7 +311,10 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
|
|||||||
if (!(binding_desc = vkd3d_calloc(descriptor_count, sizeof(*binding_desc))))
|
if (!(binding_desc = vkd3d_calloc(descriptor_count, sizeof(*binding_desc))))
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
if (!(push_constants = vkd3d_calloc(push_count, sizeof(*push_constants))))
|
if (!(push_constants = vkd3d_calloc(push_count, sizeof(*push_constants))))
|
||||||
|
{
|
||||||
|
vkd3d_free(binding_desc);
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
/* Map root constants to push constants. */
|
/* Map root constants to push constants. */
|
||||||
for (i = 0, j = 0; i < desc->NumParameters; ++i)
|
for (i = 0, j = 0; i < desc->NumParameters; ++i)
|
||||||
@ -330,9 +333,7 @@ static HRESULT d3d12_root_signature_init(struct d3d12_root_signature *root_signa
|
|||||||
push_constants[j].stageFlags = stage_flags_from_visibility(p->ShaderVisibility);
|
push_constants[j].stageFlags = stage_flags_from_visibility(p->ShaderVisibility);
|
||||||
push_constants[j].offset = 0;
|
push_constants[j].offset = 0;
|
||||||
push_constants[j].size = 4 * p->u.Constants.Num32BitValues;
|
push_constants[j].size = 4 * p->u.Constants.Num32BitValues;
|
||||||
j++;
|
++j;
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cur_binding = binding_desc;
|
cur_binding = binding_desc;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user