Commit 03897685 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

usp10: Return early if the number of positioning operations is 0 in GPOS_apply_ChainContextPos().

This preserves the current logic, but I wonder if we're not supposed to always return "input_count". Returning 1 seems questionable if we matched more input glyphs than that, and so does including the lookahead count. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAric Stewart <aric@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7dfe9b9c
...@@ -2226,7 +2226,7 @@ static unsigned int GPOS_apply_ChainContextPos(const ScriptCache *script_cache, ...@@ -2226,7 +2226,7 @@ static unsigned int GPOS_apply_ChainContextPos(const ScriptCache *script_cache,
} }
else if (GET_BE_WORD(backtrack->PosFormat) == 3) else if (GET_BE_WORD(backtrack->PosFormat) == 3)
{ {
WORD backtrack_count, input_count, lookahead_count; WORD backtrack_count, input_count, lookahead_count, positioning_count;
int k; int k;
const GPOS_ChainContextPosFormat3_2 *input; const GPOS_ChainContextPosFormat3_2 *input;
const GPOS_ChainContextPosFormat3_3 *lookahead; const GPOS_ChainContextPosFormat3_3 *lookahead;
...@@ -2286,20 +2286,19 @@ static unsigned int GPOS_apply_ChainContextPos(const ScriptCache *script_cache, ...@@ -2286,20 +2286,19 @@ static unsigned int GPOS_apply_ChainContextPos(const ScriptCache *script_cache,
continue; continue;
TRACE("Matched LookAhead\n"); TRACE("Matched LookAhead\n");
if (GET_BE_WORD(positioning->PosCount)) if (!(positioning_count = GET_BE_WORD(positioning->PosCount)))
return 1;
for (k = 0; k < positioning_count; ++k)
{ {
for (k = 0; k < GET_BE_WORD(positioning->PosCount); ++k) WORD lookup_index = GET_BE_WORD(positioning->PosLookupRecord[k].LookupListIndex);
{ WORD sequence_index = GET_BE_WORD(positioning->PosLookupRecord[k].SequenceIndex) * write_dir;
int lookupIndex = GET_BE_WORD(positioning->PosLookupRecord[k].LookupListIndex);
int SequenceIndex = GET_BE_WORD(positioning->PosLookupRecord[k].SequenceIndex) * write_dir;
TRACE("Position: %i -> %i %i\n",k, SequenceIndex, lookupIndex); TRACE("Position: %u -> %u %u.\n", k, sequence_index, lookup_index);
GPOS_apply_lookup(script_cache, otm, logfont, analysis, advance, lookup, lookupIndex, GPOS_apply_lookup(script_cache, otm, logfont, analysis, advance, lookup, lookup_index,
glyphs, glyph_index + SequenceIndex, glyph_count, goffset); glyphs, glyph_index + sequence_index, glyph_count, goffset);
}
return input_count + lookahead_count;
} }
else return 1; return input_count + lookahead_count;
} }
else else
FIXME("Unhandled Chaining Contextual Positioning Format %#x.\n", GET_BE_WORD(backtrack->PosFormat)); FIXME("Unhandled Chaining Contextual Positioning Format %#x.\n", GET_BE_WORD(backtrack->PosFormat));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment