From a2444346220757e7743c972cbd24f925e72b419d Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 29 May 2018 18:32:57 -0700 Subject: [PATCH] [map] Fix resize --- src/hb-map-private.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hb-map-private.hh b/src/hb-map-private.hh index aaf675aa4..0baec0827 100644 --- a/src/hb-map-private.hh +++ b/src/hb-map-private.hh @@ -110,9 +110,10 @@ struct hb_map_t items = new_items; /* Insert back old items. */ - for (unsigned int i = 0; i < old_size; i++) - if (old_items[i].key != INVALID && old_items[i].value != INVALID) - set (old_items[i].key, old_items[i].value); + if (old_items) + for (unsigned int i = 0; i < old_size; i++) + if (old_items[i].key != INVALID && old_items[i].value != INVALID) + set (old_items[i].key, old_items[i].value); free (old_items);