Commit 814dc299 by Jonah Ryan-Davis Committed by Angle LUCI CQ

Add nullptr check for pfnGetPhysicalDeviceProperties

This function may be called without checking the pointer. Speculative fix for a crash in GetSystemInfoVulkan. Bug: chromium:1211839 Change-Id: Ia7fa55fc328d02bdcd6d48e9b93f552aaea2b284 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2917353Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
parent f410e81a
...@@ -153,7 +153,7 @@ bool GetSystemInfoVulkan(SystemInfo *info) ...@@ -153,7 +153,7 @@ bool GetSystemInfoVulkan(SystemInfo *info)
auto pfnGetPhysicalDeviceProperties = auto pfnGetPhysicalDeviceProperties =
vkLibrary.getProc<PFN_vkGetPhysicalDeviceProperties>("vkGetPhysicalDeviceProperties"); vkLibrary.getProc<PFN_vkGetPhysicalDeviceProperties>("vkGetPhysicalDeviceProperties");
uint32_t physicalDeviceCount = 0; uint32_t physicalDeviceCount = 0;
if (!pfnEnumeratePhysicalDevices || if (!pfnEnumeratePhysicalDevices || !pfnGetPhysicalDeviceProperties ||
pfnEnumeratePhysicalDevices(instance, &physicalDeviceCount, nullptr) != VK_SUCCESS) pfnEnumeratePhysicalDevices(instance, &physicalDeviceCount, nullptr) != VK_SUCCESS)
{ {
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment