[vector] Avoid double-free in draw blob creation

Mirror the blob-creation failure fix from vector paint in the SVG
draw path. The non-recycled branch handed ownership to
hb_blob_create(), which may already run the destroy callback on
failure, and then fell into local cleanup that freed the same buffer
again.

Switch that branch to hb_blob_create_or_fail() so failure reports
nullptr without conflicting cleanup.

Tested:
- meson compile -C build hb-vector-fuzzer

Assisted-by: OpenAI Codex
This commit is contained in:
Behdad Esfahbod committed 2026-03-10 10:41:10 -03:00
1 parent c395ca8a43
commit b6b8f8dcca
1 file changed
+3 -1
+3 -1
View File
@@ -217,7 +217,9 @@ hb_svg_blob_from_buffer (hb_blob_t **recycled_blob,
else
{
hb_svg_blob_meta_set_buffer (meta, data, allocated);
blob = hb_blob_create (data, len, HB_MEMORY_MODE_WRITABLE, meta, hb_svg_blob_meta_destroy);
blob = hb_blob_create_or_fail (data, len, HB_MEMORY_MODE_WRITABLE, meta, hb_svg_blob_meta_destroy);
if (unlikely (!blob))
return nullptr;
}
if (unlikely (blob == hb_blob_get_empty ()))