# HG changeset patch # User Patric Stout # Date 2023-05-08 16:09:47 # Node ID e17e476b3c23a084614fd22dd4786feb36c67b20 # Parent 3bb11625e41b98d6b8d0d4895121a20861d64259 Fix: [ICU] crash when trying to break a non-breaking run (#10791) Clusters from harfbuzz are indexed from the start of the buffer, not from the start of the run analyzed. This confuses other parts of the code that do assume they are from the start of the run. diff --git a/src/gfx_layout_icu.cpp b/src/gfx_layout_icu.cpp --- a/src/gfx_layout_icu.cpp +++ b/src/gfx_layout_icu.cpp @@ -208,7 +208,7 @@ void ICURun::Shape(UChar *buff, size_t b x_advance = glyph_pos[i].x_advance / FONT_SCALE; } - this->glyph_to_char.push_back(glyph_info[i].cluster); + this->glyph_to_char.push_back(glyph_info[i].cluster - this->start); this->advance.push_back(x_advance); advance += x_advance; }