From eb7bdbcb5d15b19a38dc726968f4e4b59b8080e1 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Fri, 2 Feb 2018 12:49:28 -0800 Subject: vkGetDeviceQueue2: add a NULL check The current driver::GetDeviceQueue2() will indeed crash if the driver returns a NULL queue, which it is supposed to do if the pQueueInfo->flags doesn't match the flags requested for the queue family. Thus need to add a NULL check for pQueue here in case. Test: deqp vulkancts test Bug: b/72867433 Change-Id: I306c1a1db52a9986801357eaeb357536ecb0428e --- vulkan/libvulkan/driver.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vulkan/libvulkan/driver.cpp') diff --git a/vulkan/libvulkan/driver.cpp b/vulkan/libvulkan/driver.cpp index c8e7bd9734..1fceb4ac5e 100644 --- a/vulkan/libvulkan/driver.cpp +++ b/vulkan/libvulkan/driver.cpp @@ -1170,7 +1170,8 @@ void GetDeviceQueue2(VkDevice device, const auto& data = GetData(device); data.driver.GetDeviceQueue2(device, pQueueInfo, pQueue); - SetData(*pQueue, data); + if (pQueue != VK_NULL_HANDLE) + SetData(*pQueue, data); } VKAPI_ATTR VkResult -- cgit v1.2.3-59-g8ed1b