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

This commit is contained in:
Garret Rieger 2020-07-30 12:20:31 -07:00 committed by Ebrahim Byagowi
parent 0d22fb38b9
commit 4cbc7d61bc

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