diff --git a/cpp/src/monoformat_structured.cpp b/cpp/src/monoformat_structured.cpp index 185952a..ac29a06 100644 --- a/cpp/src/monoformat_structured.cpp +++ b/cpp/src/monoformat_structured.cpp @@ -1513,6 +1513,9 @@ std::expected, ParseError> ClippedTextElemen return std::unexpected(textLength.error()); } std::size_t alignedRoundedUp = (*textLength + 2 + 4 - 1) / 4 * 4 - 2; + if (formatVersion >= 2) { + alignedRoundedUp = (*textLength + 4 - 1) / 4 * 4; + } auto textData = readBuffer(buffer, alignedRoundedUp); if (!textData) { return std::unexpected(textData.error());