mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-22 23:41:03 +01:00
[layout] Limit how far we skip when looking back
See comments.
This commit is contained in:
1 parent
d18fd3f7eb
commit
85be877925
1 file changed
+7
@@ -578,6 +578,13 @@ struct hb_ot_apply_context_t :
|
||||
unsigned stop = num_items - 1;
|
||||
if (c->buffer->flags & HB_BUFFER_FLAG_PRODUCE_UNSAFE_TO_CONCAT)
|
||||
stop = 1 - 1;
|
||||
|
||||
/* When looking back, limit how far we search; this function is mostly
|
||||
* used for looking back for base glyphs when attaching marks. If we
|
||||
* don't limit, we can get O(n^2) behavior where n is the number of
|
||||
* consecutive marks. */
|
||||
stop = (unsigned) hb_max ((int) stop, (int) idx - HB_MAX_CONTEXT_LENGTH);
|
||||
|
||||
while (idx > stop)
|
||||
{
|
||||
idx--;
|
||||
|
||||
Reference in new issue
Block a user