mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-22 23:41:03 +01:00
hb_gpu_draw_encode() could allocate a fresh output buffer and then return NULL before transferring ownership to a blob, leaking that temporary buffer on late encode failures. The recycled-blob growth path also tried hb_realloc() first and fell back to hb_malloc() when that failed. Once the new buffer was committed to the recycled blob, the old recycled buffer could be orphaned. Free temporary buffers on the remaining late-failure exits and keep the old recycled buffer alive until a replacement has been committed. Tighten the GPU API recycle test to encode a larger second outline so that reused-buffer growth stays covered. Tested: - meson test -C build Assisted-by: OpenAI Codex <codex@openai.com>