diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp index 6f663d5f9b..1024c8162f 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp @@ -884,7 +884,7 @@ HB_Bool HB_SelectScript(HB_ShaperItem *shaper_item, const HB_OpenTypeFeature *fe static HB_Bool containsSurrogates(HB_ShaperItem *item) { - for (hb_uint32 i=0; istringLength; ++i) { + for (hb_uint32 i=item->item.pos; iitem.pos+item->item.length; ++i) { HB_UChar16 ucs = item->string[i]; if ( HB_IsHighSurrogate(ucs) || HB_IsLowSurrogate(ucs) ) return true;