From 0805c9d404d790ce20c3924cfdc5c0b9d7256b14 Mon Sep 17 00:00:00 2001 From: Slawomir Cygan Date: Tue, 27 Mar 2018 16:41:33 +0200 Subject: [PATCH] Fix stack overflow on vkGetPhysicalDeviceSparseImageFormatProperties Function may return random number of structs overwriting the sparseImageFormatProperties variable. Components: Vulkan VK-GL-CTS Issue: 1103 Affects: dEQP-VK.texture.*.sparse_* Change-Id: I101b72360145c23cef14cfeb50c7f9cd02e62e2f --- external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.cpp b/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.cpp index e6a6194..a1badbd 100644 --- a/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.cpp +++ b/external/vulkancts/modules/vulkan/texture/vktTextureTestUtil.cpp @@ -345,9 +345,8 @@ void TextureBinding::updateTextureData (const TestTextureSp& textureData, const if (sparse) { - deUint32 numSparseImageProperties; - vk::VkSparseImageFormatProperties sparseImageFormatProperties; - m_context.getInstanceInterface().getPhysicalDeviceSparseImageFormatProperties(m_context.getPhysicalDevice(), format, imageType, VK_SAMPLE_COUNT_1_BIT, imageUsageFlags, imageTiling, &numSparseImageProperties, &sparseImageFormatProperties); + deUint32 numSparseImageProperties = 0; + m_context.getInstanceInterface().getPhysicalDeviceSparseImageFormatProperties(m_context.getPhysicalDevice(), format, imageType, VK_SAMPLE_COUNT_1_BIT, imageUsageFlags, imageTiling, &numSparseImageProperties, DE_NULL); if (numSparseImageProperties == 0) TCU_THROW(NotSupportedError, (std::string("Sparse format not supported: ") + vk::getFormatName(format)).c_str()); } -- 2.7.4