From 3b28cff9c078d9a29b611a2b7fe014b8e4168762 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 26 May 2022 04:42:17 -0600 Subject: [PATCH] [cff1] Fix null dereference on memory alloc failure --- src/hb-ot-cff1-table.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index b5047002a..f441f6a4d 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -1413,10 +1413,10 @@ struct cff1 } goto retry; } - } + } gname_t key = { hb_bytes_t (name, len), 0 }; - const gname_t *gname = glyph_names->bsearch (key); + const gname_t *gname = names ? names->bsearch (key) : nullptr; if (!gname) return false; hb_codepoint_t gid = sid_to_glyph (gname->sid); if (!gid && gname->sid) return false;