From eebc21c8de08d58c806fcd3d0f3a5aedee867776 Mon Sep 17 00:00:00 2001 From: Michiharu Ariza Date: Wed, 20 Feb 2019 12:43:18 -0800 Subject: [PATCH] fix crash in hb_map_t::clear() in case called immediately after init() --- src/hb-map.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hb-map.hh b/src/hb-map.hh index 02d5406..fd5c6d8 100644 --- a/src/hb-map.hh +++ b/src/hb-map.hh @@ -170,7 +170,8 @@ struct hb_map_t void clear () { - memset (items, 0xFF, ((size_t) mask + 1) * sizeof (item_t)); + if (items) + memset (items, 0xFF, ((size_t) mask + 1) * sizeof (item_t)); population = occupancy = 0; } -- 2.7.4