From: Samuel Iglesias Gonsálvez Date: Wed, 8 Apr 2020 08:55:37 +0000 (+0200) Subject: radv: check buffer size in vkCreateBuffer() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc678c9ce934c1c83f6ed26696f896ca96ddefc1;p=mesa.git radv: check buffer size in vkCreateBuffer() Fixes: dEQP-VK.api.buffer.basic.size_max_uint64 Signed-off-by: Samuel Iglesias Gonsálvez Reviewed-by: Bas Nieuwenhuizen Reviewed-by: Samuel Pitoiset Part-of: --- diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 00e3a7ca947..fb81d782a14 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -6237,6 +6237,9 @@ VkResult radv_CreateBuffer( RADV_FROM_HANDLE(radv_device, device, _device); struct radv_buffer *buffer; + if (pCreateInfo->size > RADV_MAX_MEMORY_ALLOCATION_SIZE) + return VK_ERROR_OUT_OF_DEVICE_MEMORY; + assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO); buffer = vk_alloc2(&device->alloc, pAllocator, sizeof(*buffer), 8,