radv: fix accessing NULL pointers when destroy the VRS image
Detected by UBSAN. ../src/amd/vulkan/radv_private.h:2939:1: runtime error: member access within null pointer of type 'struct radv_device_memory' ../src/amd/vulkan/radv_private.h:2926:1: runtime error: member access within null pointer of type 'struct radv_buffer' ../src/amd/vulkan/radv_private.h:2945:1: runtime error: member access within null pointer of type 'struct radv_image' Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13965>
This commit is contained in:
parent
6923dd687c
commit
a58f68fc68
|
@ -2863,6 +2863,9 @@ fail_create:
|
|||
static void
|
||||
radv_device_finish_vrs_image(struct radv_device *device)
|
||||
{
|
||||
if (!device->vrs.image)
|
||||
return;
|
||||
|
||||
radv_FreeMemory(radv_device_to_handle(device), radv_device_memory_to_handle(device->vrs.mem),
|
||||
&device->meta_state.alloc);
|
||||
radv_DestroyBuffer(radv_device_to_handle(device), radv_buffer_to_handle(device->vrs.buffer),
|
||||
|
|
Loading…
Reference in New Issue