1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

SimpleShapedText: Fix overallocating s32 buffer

Prior to this commit we overallocated the s32 buffer. The buffer was
unnecessarily padded by zeros, and the line stating this, wasn't
actually dropping the null terminator.
This commit is contained in:
attila 2025-05-07 10:55:03 +02:00 committed by Attila Szarvas
parent bc4ea1a66f
commit 10b6289295

View file

@ -879,7 +879,7 @@ struct Shaper
const auto string32 = std::invoke ([this]
{
std::vector<juce_wchar> s32 (CharPointer_UTF32::getBytesRequiredFor (string.getCharPointer()));
std::vector<juce_wchar> s32 ((size_t) string.length() + 1);
string.copyToUTF32 (s32.data(), s32.size() * sizeof (juce_wchar));
jassert (! s32.empty());
s32.pop_back(); // dropping the null terminator