layers: draw_state allow pInheritanceInfo NULL
authorMike Stroyan <stroyan@google.com>
Wed, 10 Feb 2016 15:29:08 +0000 (08:29 -0700)
committerMike Stroyan <stroyan@google.com>
Wed, 10 Feb 2016 15:29:08 +0000 (08:29 -0700)
The pInheritanceInfo field in VkCommandBufferBeginInfo may be NULL.
Test for that before using it in draw_state layer.

layers/draw_state.cpp

index 5a86b9d..ce3e3f8 100644 (file)
@@ -4550,7 +4550,7 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuf
                                         "support precise occlusion queries.", reinterpret_cast<void*>(commandBuffer));
                 }
             }
-            if (pInfo->renderPass != VK_NULL_HANDLE) {
+            if (pInfo && pInfo->renderPass != VK_NULL_HANDLE) {
                 auto rp_data = dev_data->renderPassMap.find(pInfo->renderPass);
                 if (rp_data != dev_data->renderPassMap.end() && rp_data->second && rp_data->second->pCreateInfo) {
                     if (pInfo->subpass >= rp_data->second->pCreateInfo->subpassCount) {