[ENOMEM] check for unset current in serializer->length().

This commit is contained in:
Garret Rieger authored and Ebrahim Byagowi committed 2020-07-31 02:04:06 +04:30
1 parent 0d22fb38b9
commit 4cbc7d61bc
1 file changed
+5 -1
+5 -1
View File
@@ -373,7 +373,11 @@ struct hb_serialize_context_t
}
}
unsigned int length () const { return this->head - current->head; }
unsigned int length () const
{
if (unlikely (!current)) return 0;
return this->head - current->head;
}
void align (unsigned int alignment)
{