From ad7789a6899e3e2d5a1116fd98a93f59247a34e3 Mon Sep 17 00:00:00 2001 From: yuuko Date: Sun, 17 May 2026 12:34:29 -0700 Subject: [PATCH] vtfpp: remedy crash under libcxx --- src/vtfpp/VTF.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vtfpp/VTF.cpp b/src/vtfpp/VTF.cpp index cc847ecc..cca38871 100644 --- a/src/vtfpp/VTF.cpp +++ b/src/vtfpp/VTF.cpp @@ -1662,6 +1662,9 @@ void VTF::setResourceInternal(Resource::Type type, std::span da } auto& [specificResourceData, offset] = resourceData[resourceType]; if (resourceType == type) { + if (!this->data.data()) { + this->data.reserve(offset + specificResourceData.size()); + } Resource newResource{ type, specificResourceData.size() <= sizeof(uint32_t) ? Resource::FLAG_LOCAL_DATA : Resource::FLAG_NONE,