st/oxr: Fix crash when there is no optional extension in the list

This commit is contained in:
Jakob Bornecrantz 2022-05-13 22:48:44 +01:00 committed by Ryan Pavlik
parent 2e42373d21
commit 82e2ce6390

View file

@ -332,7 +332,8 @@ oxr_vk_create_vulkan_device(struct oxr_logger *log,
#endif
for (uint32_t i = 0; i < ARRAY_SIZE(optional_device_extensions); i++) {
if (optional_device_extensions[i] &&
// Empty list or a not supported extension.
if (optional_device_extensions[i] == NULL ||
!vk_check_extension(props, prop_count, optional_device_extensions[i])) {
continue;
}