[subset] Fix fuzzer crash.

https://oss-fuzz.com/testcase-detail/6608005089853440
This commit is contained in:
Garret Rieger authored and Behdad Esfahbod committed 2023-05-30 18:56:48 +02:00
1 parent ff326fbe8f
commit f3b4d35f36
2 files changed
+5 -1

No files matched your search

+5 -1
View File
@@ -323,6 +323,8 @@ struct hb_serialize_context_t
{
object_t *obj = current;
if (unlikely (!obj)) return;
// Allow cleanup when we've error'd out on int overflows which don't compromise
// the serializer state.
if (unlikely (in_error() && !only_overflow ())) return;
current = current->next;
@@ -340,7 +342,9 @@ struct hb_serialize_context_t
{
object_t *obj = current;
if (unlikely (!obj)) return 0;
if (unlikely (in_error())) return 0;
// Allow cleanup when we've error'd out on int overflows which don't compromise
// the serializer state.
if (unlikely (in_error() && !only_overflow ())) return 0;
current = current->next;
obj->tail = head;