Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/dwrite/opentype.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index 125b7353031..39943c52c9a 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -4733,7 +4733,7 @@ static void opentype_layout_get_glyph_range_for_text(struct scriptshaping_contex if (end_char >= context->length - 1) *end_glyph = context->glyph_count - 1; else - *end_glyph = context->u.buffer.clustermap[end_char + 1] - 1; + *end_glyph = context->u.buffer.clustermap[end_char] - 1; }
static void opentype_layout_set_glyph_masks(struct scriptshaping_context *context, const struct shaping_features *features) @@ -4754,6 +4754,9 @@ static void opentype_layout_set_glyph_masks(struct scriptshaping_context *contex if (start_char >= context->length) break;
+ if (!context->user_features.range_lengths[r]) + continue; + opentype_layout_get_glyph_range_for_text(context, start_char, start_char + context->user_features.range_lengths[r], &start_glyph, &end_glyph); start_char += context->user_features.range_lengths[r];