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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user