From 2eb7e0e0e923d096d2598133cacd6e5ee04a6a04 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 7 May 2019 12:45:38 -0700 Subject: [PATCH] [serialize] Minor --- src/hb-serialize.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-serialize.hh b/src/hb-serialize.hh index 27c8c1778..7e46df265 100644 --- a/src/hb-serialize.hh +++ b/src/hb-serialize.hh @@ -165,7 +165,7 @@ struct hb_serialize_context_t /* Only "pack" if there exist other objects... Otherwise, don't bother. * Saves a move. */ - if (packed.length == 1) + if (packed.length <= 1) return; pop_pack (); @@ -285,7 +285,10 @@ struct hb_serialize_context_t void resolve_links () { + if (unlikely (in_error ())) return; + assert (!current); + assert (packed.length > 1); for (const object_t *parent : ++hb_iter (packed)) {