mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d: Validate sub-resource index in d3d12_resource_Unmap().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
91c11eed03
commit
361e5f6274
@ -885,11 +885,19 @@ static void STDMETHODCALLTYPE d3d12_resource_Unmap(ID3D12Resource *iface, UINT s
|
||||
const D3D12_RANGE *written_range)
|
||||
{
|
||||
struct d3d12_resource *resource = impl_from_ID3D12Resource(iface);
|
||||
unsigned int sub_resource_count;
|
||||
struct d3d12_device *device;
|
||||
|
||||
TRACE("iface %p, sub_resource %u, written_range %p.\n",
|
||||
iface, sub_resource, written_range);
|
||||
|
||||
sub_resource_count = d3d12_resource_desc_get_sub_resource_count(&resource->desc);
|
||||
if (sub_resource >= sub_resource_count)
|
||||
{
|
||||
WARN("Sub-resource index %u is out of range (%u sub-resources).\n", sub_resource, sub_resource_count);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!resource->map_count)
|
||||
{
|
||||
WARN("Resource %p is not mapped.\n", resource);
|
||||
|
Loading…
x
Reference in New Issue
Block a user