summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichiharu Ariza <ariza@adobe.com>2019-02-20 12:43:18 -0800
committerMichiharu Ariza <ariza@adobe.com>2019-02-20 12:43:18 -0800
commiteebc21c8de08d58c806fcd3d0f3a5aedee867776 (patch)
tree9b8e4387bd01c914dd1e4c2e7551dd7ce9fd34c5
parenta17ed8459ee1e01caf4761f682bcda821bc8e656 (diff)
fix crash in hb_map_t::clear()
in case called immediately after init()
-rw-r--r--src/hb-map.hh3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/hb-map.hh b/src/hb-map.hh
index 02d54066..fd5c6d8b 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;
}