[serialize] Don't insert empty object into tree

This commit is contained in:
Behdad Esfahbod 2019-03-30 19:26:37 -07:00
parent 7fd8228326
commit d74dc3ef65
1 changed files with 4 additions and 1 deletions

View File

@ -160,6 +160,9 @@ struct hb_serialize_context_t
memmove (tail, obj.head, len);
head = obj.head;
if (!len)
return 0;
obj.head = tail;
obj.tail = tail + len;
@ -304,7 +307,7 @@ struct hb_serialize_context_t
hb_vector_t<object_t> packed;
/* Map view of packed objects. */
hb_hashmap_t<const object_t *, objidx_t> packed_map;
hb_hashmap_t<const object_t *, objidx_t, nullptr, 0> packed_map;
};