[directwrite] Use correct UTF-16 string length Fixes https://github.com/harfbuzz/harfbuzz/issues/2474
diff --git a/src/hb-directwrite.cc b/src/hb-directwrite.cc index a073021..aebe9e0 100644 --- a/src/hb-directwrite.cc +++ b/src/hb-directwrite.cc
@@ -623,7 +623,7 @@ * but we never attempt to shape a word longer than 64K characters * in a single gfxShapedWord, so we cannot exceed that limit. */ - uint32_t textLength = buffer->len; + uint32_t textLength = chars_len; TextAnalysis analysis (textString, textLength, nullptr, readingDirection); TextAnalysis::Run *runHead;