mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-09-13 09:16:14 -07:00
vkd3d-utils: Fix bounds comparison against element counts.
This commit is contained in:
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
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user