mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 00:20:09 +01:00
anv: avoid segmentation fault due to vk_error()
vk_error() is a macro that calls __vk_errorf() with instance == NULL.
Then, __vk_errorf() passes a pointer to instance->debug_report_callbacks
to vk_debug_error(), which segfaults as this pointer is invalid but not
NULL.
Fixes: e5b1bd6ab8 "vulkan: move anv VK_EXT_debug_report implementation to common code."
Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
This commit is contained in:
parent
32170d87e3
commit
7109a1fe13
1 changed files with 10 additions and 8 deletions
|
|
@ -99,6 +99,7 @@ __vk_errorf(struct anv_instance *instance, const void *object,
|
||||||
snprintf(report, sizeof(report), "%s:%d: %s", file, line, error_str);
|
snprintf(report, sizeof(report), "%s:%d: %s", file, line, error_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (instance) {
|
||||||
vk_debug_report(&instance->debug_report_callbacks,
|
vk_debug_report(&instance->debug_report_callbacks,
|
||||||
VK_DEBUG_REPORT_ERROR_BIT_EXT,
|
VK_DEBUG_REPORT_ERROR_BIT_EXT,
|
||||||
type,
|
type,
|
||||||
|
|
@ -107,6 +108,7 @@ __vk_errorf(struct anv_instance *instance, const void *object,
|
||||||
0,
|
0,
|
||||||
"anv",
|
"anv",
|
||||||
report);
|
report);
|
||||||
|
}
|
||||||
|
|
||||||
intel_loge("%s", report);
|
intel_loge("%s", report);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue