vkd3d-utils: Fix bounds comparison against element counts.

This commit is contained in:
Zebediah Figura 2024-05-02 20:56:40 -05:00 committed by Alexandre Julliard
parent 2480eec98b
commit 68562d375e
Notes: Alexandre Julliard 2024-05-06 22:37:40 +02:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/848

View File

@ -102,7 +102,7 @@ static ID3D12ShaderReflectionType * STDMETHODCALLTYPE d3d12_type_GetMemberTypeBy
TRACE("iface %p, index %u.\n", iface, index);
if (index > type->desc.Members)
if (index >= type->desc.Members)
{
WARN("Invalid index %u.\n", index);
return &null_type.ID3D12ShaderReflectionType_iface;
@ -301,7 +301,7 @@ static ID3D12ShaderReflectionVariable * STDMETHODCALLTYPE d3d12_buffer_GetVariab
TRACE("iface %p, index %u.\n", iface, index);
if (index > buffer->desc.Variables)
if (index >= buffer->desc.Variables)
{
WARN("Invalid index %u.\n", index);
return &null_variable.ID3D12ShaderReflectionVariable_iface;
@ -422,7 +422,7 @@ static struct ID3D12ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3d12_ref
TRACE("iface %p, index %u.\n", iface, index);
if (index > reflection->desc.ConstantBuffers)
if (index >= reflection->desc.ConstantBuffers)
{
WARN("Invalid index %u.\n", index);
return &null_buffer.ID3D12ShaderReflectionConstantBuffer_iface;