[otlayout] Guard against use of ReverseChain through Context
This commit is contained in:
parent
74f4bbf056
commit
49901862e3
|
@ -1037,7 +1037,9 @@ struct ReverseChainSingleSubstFormat1
|
||||||
1))
|
1))
|
||||||
{
|
{
|
||||||
c->replace_glyph_inplace (substitute[index]);
|
c->replace_glyph_inplace (substitute[index]);
|
||||||
c->buffer->idx--; /* Reverse! */
|
/* Note: We DON'T decrease buffer->idx. The main loop does it
|
||||||
|
* for us. This is useful for preventing surprises if someone
|
||||||
|
* calls us through a Context lookup. */
|
||||||
return TRACE_RETURN (true);
|
return TRACE_RETURN (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -867,8 +867,8 @@ apply_string (OT::hb_apply_context_t *c,
|
||||||
(c->buffer->cur().mask & c->lookup_mask) &&
|
(c->buffer->cur().mask & c->lookup_mask) &&
|
||||||
apply_once (c, lookup))
|
apply_once (c, lookup))
|
||||||
ret = true;
|
ret = true;
|
||||||
else
|
/* The reverse lookup doesn't "advance" cursor (for good reason). */
|
||||||
c->buffer->idx--;
|
c->buffer->idx--;
|
||||||
|
|
||||||
}
|
}
|
||||||
while ((int) c->buffer->idx >= 0);
|
while ((int) c->buffer->idx >= 0);
|
||||||
|
|
Loading…
Reference in New Issue