2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

configure_graphics: Prevent stack-use-after-scope

Address Sanitizer reports stack-use-after-scope on line 231
`vulkan_devices.push_back(QString::fromStdString(name));`. Instead of
using a pointer, copy the string into a std::string and use that,
instead.
This commit is contained in:
lat9nq 2021-04-04 15:02:35 -04:00
parent 69b2dbdffd
commit 33ed02a239

View file

@ -227,7 +227,7 @@ void ConfigureGraphics::RetrieveVulkanDevices() try {
vulkan_devices.clear(); vulkan_devices.clear();
vulkan_devices.reserve(physical_devices.size()); vulkan_devices.reserve(physical_devices.size());
for (const VkPhysicalDevice device : physical_devices) { for (const VkPhysicalDevice device : physical_devices) {
const char* const name = vk::PhysicalDevice(device, dld).GetProperties().deviceName; const std::string name = vk::PhysicalDevice(device, dld).GetProperties().deviceName;
vulkan_devices.push_back(QString::fromStdString(name)); vulkan_devices.push_back(QString::fromStdString(name));
} }