Module: vkd3d Branch: master Commit: 68562d375e0fba682bf6bfa32397c43d210ef602 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/68562d375e0fba682bf6bfa32397c4...
Author: Zebediah Figura zfigura@codeweavers.com Date: Thu May 2 20:56:40 2024 -0500
vkd3d-utils: Fix bounds comparison against element counts.
---
libs/vkd3d-utils/reflection.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-utils/reflection.c b/libs/vkd3d-utils/reflection.c index f4cc78bc..4f3a1a24 100644 --- a/libs/vkd3d-utils/reflection.c +++ b/libs/vkd3d-utils/reflection.c @@ -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;