dwrite: Fix feature mask for non-global features.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2021-01-20 17:02:34 +03:00 committed by Alexandre Julliard
parent b78285b9a3
commit 94b367e3e9
1 changed files with 3 additions and 0 deletions

View File

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