Fix buffer serialize of empty buffer

Ouch!
This commit is contained in:
Behdad Esfahbod 2017-03-07 18:13:28 -08:00
parent 8e42c3cb2b
commit 3c080a7a0a
1 changed files with 2 additions and 0 deletions

View File

@ -311,6 +311,8 @@ hb_buffer_serialize_glyphs (hb_buffer_t *buffer,
if (!buf_consumed)
buf_consumed = &sconsumed;
*buf_consumed = 0;
if (buf_size)
*buf = '\0';
assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) ||
buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS);