mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-23 07:51:10 +01:00
[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
This commit is contained in:
1 parent
4fd90c836a
commit
adf7e9dcb2
1 file changed
+2
@@ -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<char> out;
|
||||
hb_svg_recover_recycled_buffer (paint->recycled_blob, &out);
|
||||
|
||||
Reference in new issue
Block a user