From d975d23cd82d2e3cb1a3463f330e526642e2f51b Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Thu, 3 Oct 2024 11:29:12 +0200 Subject: [PATCH] radv/meta: Do not pass NULL to vk_texcompress_astc_finish The pointer can be NULL if initialization fails. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11953 Fixes: f97b449 ("radv: integrate meta astc compute decoder to radv") Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/meta/radv_meta_astc_decode.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/amd/vulkan/meta/radv_meta_astc_decode.c b/src/amd/vulkan/meta/radv_meta_astc_decode.c index f99deb1e21c..75ba521efb2 100644 --- a/src/amd/vulkan/meta/radv_meta_astc_decode.c +++ b/src/amd/vulkan/meta/radv_meta_astc_decode.c @@ -26,14 +26,11 @@ radv_device_init_meta_astc_decode_state(struct radv_device *device, bool on_dema void radv_device_finish_meta_astc_decode_state(struct radv_device *device) { - const struct radv_physical_device *pdev = radv_device_physical(device); struct radv_meta_state *state = &device->meta_state; struct vk_texcompress_astc_state *astc = state->astc_decode; - if (!pdev->emulate_astc) - return; - - vk_texcompress_astc_finish(&device->vk, &state->alloc, astc); + if (astc) + vk_texcompress_astc_finish(&device->vk, &state->alloc, astc); } static void