[cff1] Fix null dereference on memory alloc failure

This commit is contained in:
Behdad Esfahbod 2022-05-26 04:42:17 -06:00
parent 8df9aba997
commit 3b28cff9c0
1 changed files with 2 additions and 2 deletions

View File

@ -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;