From 6c0ed3f244ed5b3bf95436162244039264778f21 Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Sun, 8 Sep 2024 21:40:16 +0200 Subject: [PATCH] adding security asserts in queues getter --- kvf.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kvf.h b/kvf.h index fe80e81..81fdaac 100755 --- a/kvf.h +++ b/kvf.h @@ -1378,11 +1378,20 @@ VkQueue kvfGetDeviceQueue(VkDevice device, KvfQueueType queue) KVF_ASSERT(kvfdevice != NULL); VkQueue vk_queue = VK_NULL_HANDLE; if(queue == KVF_GRAPHICS_QUEUE) + { + KVF_ASSERT(kvfdevice->queues.graphics != -1); vkGetDeviceQueue(device, kvfdevice->queues.graphics, 0, &vk_queue); + } else if(queue == KVF_PRESENT_QUEUE) + { + KVF_ASSERT(kvfdevice->queues.present != -1); vkGetDeviceQueue(device, kvfdevice->queues.present, 0, &vk_queue); + } else if(queue == KVF_COMPUTE_QUEUE) + { + KVF_ASSERT(kvfdevice->queues.compute != -1); vkGetDeviceQueue(device, kvfdevice->queues.compute, 0, &vk_queue); + } return vk_queue; }