mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Skip descriptorCount == 0 bindings when applying initial state
* This could cause memory corruption if the final binding(s) were so empty as we write off the end of the array before eventually skipping.
This commit is contained in:
@@ -744,6 +744,11 @@ bool WrappedVulkan::Serialise_InitialState(SerialiserType &ser, ResourceId id,
|
||||
|
||||
for(uint32_t j = 0; j < initialContents.numDescriptors; j++)
|
||||
{
|
||||
uint32_t descriptorCount = layout.bindings[j].descriptorCount;
|
||||
|
||||
if(descriptorCount == 0)
|
||||
continue;
|
||||
|
||||
writes[bind].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
||||
writes[bind].pNext = NULL;
|
||||
|
||||
@@ -756,8 +761,6 @@ bool WrappedVulkan::Serialise_InitialState(SerialiserType &ser, ResourceId id,
|
||||
writes[bind].descriptorCount = 0;
|
||||
writes[bind].descriptorType = layout.bindings[j].descriptorType;
|
||||
|
||||
uint32_t descriptorCount = layout.bindings[j].descriptorCount;
|
||||
|
||||
ResourceId *immutableSamplers = layout.bindings[j].immutableSampler;
|
||||
|
||||
DescriptorSetSlot *src = srcData;
|
||||
|
||||
Reference in New Issue
Block a user