layers: Fix access violation in LVT
Was sending an out-of-scope memory reference to the display driver
in unique_objects::AllocateMemory.
Change-Id: I6b700445125acab040310682c96e7507d0fd91aa
diff --git a/layers/unique_objects.cpp b/layers/unique_objects.cpp
index b23f774..1a79d77 100644
--- a/layers/unique_objects.cpp
+++ b/layers/unique_objects.cpp
@@ -335,11 +335,11 @@
const VkAllocationCallbacks *pAllocator, VkDeviceMemory *pMemory) {
const VkMemoryAllocateInfo *input_allocate_info = pAllocateInfo;
std::unique_ptr<safe_VkMemoryAllocateInfo> safe_allocate_info;
+ std::unique_ptr<safe_VkDedicatedAllocationMemoryAllocateInfoNV> safe_dedicated_allocate_info;
layer_data *device_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
if ((pAllocateInfo != nullptr) &&
ContainsExtStruct(pAllocateInfo, VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV)) {
- std::unique_ptr<safe_VkDedicatedAllocationMemoryAllocateInfoNV> safe_dedicated_allocate_info;
// Assuming there is only one extension struct of this type in the list for now
safe_dedicated_allocate_info =
std::unique_ptr<safe_VkDedicatedAllocationMemoryAllocateInfoNV>(new safe_VkDedicatedAllocationMemoryAllocateInfoNV);