From adf7e9dcb2e81ba25e4508d4d9b274357ea58ffc Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 10 Mar 2026 10:50:02 -0300 Subject: [PATCH] [vector] Guard paint render after init failure hb_vector_paint_render() assumed ensure_initialized() had created the root group body and indexed group_stack[0] unconditionally. Under malloc-failure fuzzing, initialization can fail while extents are already set, leaving group_stack empty and causing a null-deref. Return nullptr if initialization did not produce the root group. Assisted-by: OpenAI Codex --- src/hb-vector-svg-paint.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/hb-vector-svg-paint.cc b/src/hb-vector-svg-paint.cc index e3d0a6eff..470d68df0 100644 --- a/src/hb-vector-svg-paint.cc +++ b/src/hb-vector-svg-paint.cc @@ -2093,6 +2093,8 @@ hb_vector_paint_render (hb_vector_paint_t *paint) return nullptr; hb_vector_paint_ensure_initialized (paint); + if (unlikely (!paint->group_stack.length)) + return nullptr; hb_vector_t out; hb_svg_recover_recycled_buffer (paint->recycled_blob, &out);