removed variable-sized array (flutter/engine#23102)

This is undefined behavior. I've replaced it with std::vector instead

Co-authored-by: Zachary Anderson <zanderso@users.noreply.github.com>
This commit is contained in:
Basit Ayantunde 2021-01-14 14:33:29 -08:00 committed by GitHub
parent b9b83f2112
commit 2d809abbb3

View File

@ -288,9 +288,11 @@ int VulkanDevice::ChooseSurfaceFormat(const VulkanSurface& surface,
return -1;
}
VkSurfaceFormatKHR formats[format_count];
std::vector<VkSurfaceFormatKHR> formats;
formats.resize(format_count);
if (VK_CALL_LOG_ERROR(vk.GetPhysicalDeviceSurfaceFormatsKHR(
physical_device_, surface.Handle(), &format_count, formats)) !=
physical_device_, surface.Handle(), &format_count, formats.data())) !=
VK_SUCCESS) {
return -1;
}