From: Charles Giessen Date: Fri, 23 Jun 2023 03:36:39 +0000 (-0600) Subject: Remove indexing on layer_prop_list X-Git-Tag: upstream/1.3.268~84 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44211ff2337104a934555a869343b99f52e05815;p=platform%2Fupstream%2FVulkan-Loader.git Remove indexing on layer_prop_list The usage of the layer property list inside of loader_check_layer_list_for_phys_dev_ext_address was modified when the list changed from an array of struct loader_layer_properties, to an array of pointers to struct loader_layer_properties. Except, the usages of layer_prop_list were not updated in kind, leading to out of bounds indexes when searching for unknown physical device functions in layers. This causes crashes in the validation layer tests, which make use of this functionality. --- diff --git a/loader/unknown_function_handling.c b/loader/unknown_function_handling.c index 792a6bd4..650b40e4 100644 --- a/loader/unknown_function_handling.c +++ b/loader/unknown_function_handling.c @@ -203,8 +203,8 @@ bool loader_check_layer_list_for_phys_dev_ext_address(struct loader_instance *in // Find the first layer in the call chain which supports vk_layerGetPhysicalDeviceProcAddr // and call that, returning whether it found a valid pointer for this function name. // We return if the topmost layer supports GPDPA since the layer should call down the chain for us. - if (layer_prop_list[layer].interface_version > 1) { - const struct loader_layer_functions *const functions = &(layer_prop_list[layer].functions); + if (layer_prop_list->interface_version > 1) { + const struct loader_layer_functions *const functions = &(layer_prop_list->functions); if (NULL != functions->get_physical_device_proc_addr) { return NULL != functions->get_physical_device_proc_addr((VkInstance)inst->instance, funcName); }