From fece07e3032083dade581fea93a30973efe93b9d Mon Sep 17 00:00:00 2001 From: Adrian Cojocaru Date: Mon, 19 May 2025 14:12:28 +0300 Subject: [PATCH] Fix swapchain out of bounds (#3486) --- src/mbgl/vulkan/renderable_resource.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mbgl/vulkan/renderable_resource.cpp b/src/mbgl/vulkan/renderable_resource.cpp index eb46f5deb..5174c6415 100644 --- a/src/mbgl/vulkan/renderable_resource.cpp +++ b/src/mbgl/vulkan/renderable_resource.cpp @@ -160,8 +160,8 @@ void SurfaceRenderableResource::initSwapchain(uint32_t w, uint32_t h) { colorFormat = swapchainCreateInfo.imageFormat; extent = swapchainCreateInfo.imageExtent; - swapchainSemaphores.reserve(swapchainImageCount); - for (uint32_t index = 0; index < swapchainImageCount; ++index) { + swapchainSemaphores.reserve(swapchainImages.size()); + for (uint32_t index = 0; index < swapchainImages.size(); ++index) { swapchainSemaphores.emplace_back(device->createSemaphoreUnique({})); backend.setDebugName(swapchainSemaphores.back().get(), "SurfaceSemaphore_" + std::to_string(index)); }