Skip to content

Commit

Permalink
shaderObject: Fix null pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
DHrpcs3 authored and jeremyg-lunarg committed Sep 16, 2024
1 parent 116161b commit 3c95400
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layers/shader_object/shader_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2050,7 +2050,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice physicalDevi
#include "generated/shader_object_create_device_feature_structs.inl"
device_features.pNext = appended_features_chain;
instance_vtable.GetPhysicalDeviceFeatures2(physicalDevice, &device_features);
if (dynamic_rendering_ptr->dynamicRendering == VK_FALSE) {
if (!dynamic_rendering_ptr || dynamic_rendering_ptr->dynamicRendering == VK_FALSE) {
// Dynamic rendering is required
vku::FreePnextChain(device_next_chain);
allocator.pfnFree(allocator.pUserData, enabled_extension_names);
Expand Down Expand Up @@ -2080,7 +2080,7 @@ static VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice physicalDevi
};

// Append to deep-copied pNext chain
if (private_data_ptr->privateData == VK_TRUE) {
if (private_data_ptr && private_data_ptr->privateData == VK_TRUE) {
last->pNext = reinterpret_cast<VkBaseOutStructure*>(&reserved_private_data_slot);
} else {
last->pNext = appended_features_chain;
Expand Down

0 comments on commit 3c95400

Please sign in to comment.