[PATCH] dwrite: Fix feature mask for non-global features.

Nikolay Sivov nsivov at codeweavers.com
Wed Jan 20 08:02:34 CST 2021


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---

BitScanReverse() returns zero-based position.

 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;
-- 
2.29.2




More information about the wine-devel mailing list