aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kniager <jeremyk@lunarg.com>2018-04-23 16:55:00 -0600
committerjeremyk-lunarg <jeremyk@lunarg.com>2018-04-24 09:43:58 -0600
commit201ea2946df9d4dd135901f822cad9b1911a0c6e (patch)
treec7ca371bf2f3772729758898d2c989644fe1b3cf
parent5de1ff1ff66aa41e271b87dcd0b47701711f6e17 (diff)
downloadvulkan-lvl-201ea2946df9d4dd135901f822cad9b1911a0c6e.zip
vulkan-lvl-201ea2946df9d4dd135901f822cad9b1911a0c6e.tar.xz
layers: Add handling for NULL in core post call
Added handling in PostCallRecordGetImageSparseMemoryRequirements2 when a nullptr is passed to 'reqs' Change-Id: I444ec733d4a172329aceb0fcbb68568700b8f535
-rw-r--r--layers/core_validation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 0e4c4a0..265ff59 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -4150,6 +4150,10 @@ VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements(VkDevice device, VkI
static void PostCallRecordGetImageSparseMemoryRequirements2(IMAGE_STATE *image_state, uint32_t req_count,
VkSparseImageMemoryRequirements2KHR *reqs) {
+ // reqs is empty, so there is nothing to loop over and read.
+ if (reqs == nullptr) {
+ return;
+ }
std::vector<VkSparseImageMemoryRequirements> sparse_reqs(req_count);
// Migrate to old struct type for common handling with GetImageSparseMemoryRequirements()
for (uint32_t i = 0; i < req_count; ++i) {