diff --git a/src/hb-serialize.hh b/src/hb-serialize.hh index 43aea3897..d8c61f412 100644 --- a/src/hb-serialize.hh +++ b/src/hb-serialize.hh @@ -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) {