vkd3d: Return E_INVALIDARG if a descriptor range overflows.

Signed-off-by: Conor McCarthy <cmccarthy@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Conor McCarthy
2021-08-03 00:43:17 +10:00
committed by Alexandre Julliard
parent 50c4e43eaa
commit 1c96f76afc
2 changed files with 3 additions and 3 deletions

View File

@@ -612,6 +612,9 @@ static HRESULT d3d12_root_signature_init_root_descriptor_tables(struct d3d12_roo
if (range->OffsetInDescriptorsFromTableStart != D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
offset = range->OffsetInDescriptorsFromTableStart;
if (!vkd3d_bound_range(offset, range->NumDescriptors, UINT_MAX))
return E_INVALIDARG;
table->ranges[j].offset = offset;
table->ranges[j].descriptor_count = range->NumDescriptors;
table->ranges[j].descriptor_magic = vkd3d_descriptor_magic_from_d3d12(range->RangeType);