From 64ed03c9be0ddb0cba2674e22e8f377090ec5124 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 24 Jan 2023 18:30:49 -0700 Subject: [PATCH] [cff1] Return no name for out-of-range glyph IDs Was returning .notdef before. --- src/hb-ot-cff1-table.hh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index c68763fe4..8717b4a5a 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -1344,6 +1344,7 @@ struct cff1 bool get_glyph_name (hb_codepoint_t glyph, char *buf, unsigned int buf_len) const { + if (unlikely (glyph >= num_glyphs)) return false; if (unlikely (!is_valid ())) return false; if (is_CID()) return false; if (unlikely (!buf_len)) return true;