radv: Don't crash if VkExternalImageFormatProperties isn't provided.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5623
Stable: 21.2 21.3
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13786>
This commit is contained in:
Bas Nieuwenhuizen 2021-11-13 22:43:37 +01:00 committed by Marge Bot
parent fef9ef48dd
commit 68b7b4fb38

View file

@ -1796,6 +1796,13 @@ radv_GetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice,
* present and VkExternalImageFormatProperties will be ignored.
*/
if (external_info && external_info->handleType != 0) {
VkExternalImageFormatProperties fallback_external_props;
if (!external_props) {
memset(&fallback_external_props, 0, sizeof(fallback_external_props));
external_props = &fallback_external_props;
}
get_external_image_format_properties(physical_device, base_info, external_info->handleType,
&external_props->externalMemoryProperties,
&base_props->imageFormatProperties);