From 94b367e3e91212f5b68a13b897f878405580b404 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 20 Jan 2021 17:02:34 +0300 Subject: [PATCH] dwrite: Fix feature mask for non-global features. Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- dlls/dwrite/opentype.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c index 7c30678234a..a025227dfda 100644 --- a/dlls/dwrite/opentype.c +++ b/dlls/dwrite/opentype.c @@ -4518,7 +4518,10 @@ static void opentype_layout_collect_lookups(struct scriptshaping_context *contex if ((feature->flags & FEATURE_GLOBAL) && feature->max_value == 1) bits_needed = 0; else + { BitScanReverse(&bits_needed, min(feature->max_value, 256)); + bits_needed++; + } if (!feature->max_value || next_bit + bits_needed > 8 * sizeof (feature->mask)) continue;