From cf5e9899fb4080d7871f003d862081cc2ba080c1 Mon Sep 17 00:00:00 2001 From: Matus Fedorko Date: Fri, 18 Feb 2022 13:27:52 +0100 Subject: [PATCH] Fix VmaSmallVector::push_back --- include/vk_mem_alloc.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 6972e08..01c447d 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -4301,8 +4301,9 @@ VmaSmallVector::VmaSmallVector(size_t count, const AllocatorT& template void VmaSmallVector::push_back(const T& src) { - resize(m_Count + 1); - data()[m_Count] = src; + const size_t newIndex = size(); + resize(newIndex + 1); + data()[newIndex] = src; } template