[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 authored and Ebrahim Byagowi committed 2020-07-31 08:39:26 +04:30
1 parent 7f358a55f4
commit 040ed094ef
2 files changed
+3

No files matched your search

+3
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)
{