[ENOMEM] popragate packed/packed_map errors to the serializer.

Will disable further modifications based on a bad state.
This commit is contained in:
Garret Rieger 2020-07-30 15:14:02 -07:00 committed by Ebrahim Byagowi
parent 7f358a55f4
commit 040ed094ef
2 changed files with 3 additions and 0 deletions

View File

@ -259,6 +259,7 @@ struct hb_serialize_context_t
if (unlikely (packed.in_error ())) {
// obj wasn't successfully added to packed, so clean it up otherwise it's
// links will be leaked.
propagate_error (packed);
obj->fini ();
return 0;
}
@ -266,6 +267,7 @@ struct hb_serialize_context_t
objidx = packed.length - 1;
if (share) packed_map.set (obj, objidx);
propagate_error (packed_map);
return objidx;
}
@ -277,6 +279,7 @@ struct hb_serialize_context_t
current->links.shrink (snap.num_links);
revert (snap.head, snap.tail);
}
void revert (char *snap_head,
char *snap_tail)
{