From f0e737fd4b743c3471829b899a5c32bf45e68098 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 8 Mar 2021 10:31:37 +0100 Subject: [PATCH] Fix crash due to missing inlined buffer size in StringConverter --- Source/Engine/Utilities/StringConverter.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Utilities/StringConverter.h b/Source/Engine/Utilities/StringConverter.h index 5820a4990..b80170ee7 100644 --- a/Source/Engine/Utilities/StringConverter.h +++ b/Source/Engine/Utilities/StringConverter.h @@ -71,7 +71,7 @@ public: }; template -class StringAsUTF8 : public StringAsBase +class StringAsUTF8 : public StringAsBase { public: @@ -92,15 +92,14 @@ public: StringAsUTF8(const Char* text, const int32 length) { + int32 lengthUtf8; if (length + 1 < InlinedSize) { - int32 lengthUtf8; StringUtils::ConvertUTF162UTF8(text, this->_inlined, length, lengthUtf8); this->_inlined[lengthUtf8] = 0; } else { - int32 lengthUtf8; this->_dynamic = StringUtils::ConvertUTF162UTF8(text, length, lengthUtf8); this->_dynamic[lengthUtf8] = 0; } @@ -108,7 +107,7 @@ public: }; template -class StringAsUTF16 : public StringAsBase +class StringAsUTF16 : public StringAsBase { public: