Skip to content

Commit df79eff

Browse files
committed
practices: Avoid null pApplicationInfo deref
Change-Id: Ia535aea6177ebdb01bf1f14b423522178a6c980f
1 parent ae9f00a commit df79eff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

layers/best_practices_utils.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,9 @@ bool BestPractices::PreCallValidateCreateInstance(const VkInstanceCreateInfo* pC
139139
"vkCreateInstance(): Attempting to enable Device Extension %s at CreateInstance time.",
140140
pCreateInfo->ppEnabledExtensionNames[i]);
141141
}
142-
skip |= ValidateDeprecatedExtensions("CreateInstance", pCreateInfo->ppEnabledExtensionNames[i],
143-
pCreateInfo->pApplicationInfo->apiVersion,
142+
uint32_t specified_version =
143+
(pCreateInfo->pApplicationInfo ? pCreateInfo->pApplicationInfo->apiVersion : VK_API_VERSION_1_0);
144+
skip |= ValidateDeprecatedExtensions("CreateInstance", pCreateInfo->ppEnabledExtensionNames[i], specified_version,
144145
kVUID_BestPractices_CreateInstance_DeprecatedExtension);
145146
}
146147

0 commit comments

Comments
 (0)