mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
b9b83f2112
commit
2d809abbb3
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user