mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-24 08:21:32 +01:00
[aat] Drop the per-subtable buffer-pass charge to max_ops (#6605)
charge_buffer_pass() debited buffer->len from max_ops before every kerx/kern/morx subtable that applies. It mostly duplicates the HB_AAT_MAX_SUBTABLES (1024) sanitize cap, which already bounds the number of passes per table, and it charged the length of a buffer that morx may have grown against an allowance sized from the input length. Remove it and its two call sites. The kerx loop still stops once the buffer is no longer successful. The subtable-limit API tests are kept; they test the sanitize cap, not the charge. Testing: meson test -C build (all passing). Follow-up to #6513 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5ac43f0a80
commit
07cabf6e5b
3 files changed
-19
No files matched your search
@@ -155,19 +155,6 @@ struct hb_aat_apply_context_t :
|
||||
buffer_is_reversed = !buffer_is_reversed;
|
||||
}
|
||||
|
||||
/* Applying a subtable walks the whole buffer. The font controls the
|
||||
* number of subtables, so charge each pass to the buffer's work budget. */
|
||||
HB_NODISCARD bool charge_buffer_pass ()
|
||||
{
|
||||
buffer->max_ops -= buffer->len;
|
||||
if (unlikely (buffer->max_ops < 0))
|
||||
{
|
||||
buffer->successful = false;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void setup_buffer_glyph_set ()
|
||||
{
|
||||
using_buffer_glyph_set = buffer->len >= 4 && buffer_glyph_set;
|
||||
|
||||
@@ -1114,9 +1114,6 @@ struct KerxTable
|
||||
reverse = bool (st->u.header.coverage & st->u.header.Backwards) !=
|
||||
HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction);
|
||||
|
||||
if (unlikely (!c->charge_buffer_pass ()))
|
||||
break;
|
||||
|
||||
if (!c->buffer->message (c->font, "start subtable %u", c->lookup_index))
|
||||
goto skip;
|
||||
|
||||
|
||||
@@ -1270,9 +1270,6 @@ struct Chain
|
||||
bool (coverage & ChainSubtable<Types>::Backwards) !=
|
||||
HB_DIRECTION_IS_BACKWARD (c->buffer->props.direction);
|
||||
|
||||
if (unlikely (!c->charge_buffer_pass ()))
|
||||
break;
|
||||
|
||||
if (!c->buffer->message (c->font, "start chainsubtable %u", c->lookup_index))
|
||||
goto skip;
|
||||
|
||||
|
||||
Reference in new issue
Block a user