hb_gpu_cubic_to_quadratics() split a cubic up to 10 levels deep
(2,047 nodes, each with a fit test) without charging that work to the
per-glyph budget and without checking whether the accumulator still
accepted output. Once the budget was spent, acc_emit() dropped every
curve but left g->success set, so each further cubic was fully
subdivided for nothing. A VARC composite of CFF glyphs that shares one
budget across many cubic-producing components could make a single
hb_gpu_draw_glyph() (or hb_gpu_paint_glyph() clip) call spend seconds
of CPU, far past the budget, as a CPU denial of service from a small
crafted font.
Charge one unit per node and return at the top of the recursion once
g->success is false or the budget is exhausted, the same approach the
raster flattener already takes. Returning is equivalent to emitting
here because acc_emit() discards everything once the budget is
negative, so the encoded outline is unchanged for any glyph that stays
within budget; the only cost is one extra unit per node, negligible
against HB_BUDGET_GLYPH.
Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-LZRUF6D2.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>