From 16f4dc9b73a197a5ab0ad29dcf5a7ed7495ec4e1 Mon Sep 17 00:00:00 2001 From: Michiharu Ariza Date: Wed, 1 Aug 2018 16:06:52 -0700 Subject: [PATCH] fixed CFF2VariationStore::serialize also get_size --- src/hb-ot-cff2-table.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hb-ot-cff2-table.hh b/src/hb-ot-cff2-table.hh index fadd66f5f..51be16764 100644 --- a/src/hb-ot-cff2-table.hh +++ b/src/hb-ot-cff2-table.hh @@ -49,13 +49,14 @@ struct CFF2VariationStore inline bool serialize (hb_serialize_context_t *c, const CFF2VariationStore *varStore) { TRACE_SANITIZE (this); - CFF2VariationStore *dest = c->allocate_size (varStore->size); + unsigned int size_ = varStore->get_size (); + CFF2VariationStore *dest = c->allocate_size (size_); if (unlikely (dest == nullptr)) return_trace (false); - memcpy (dest, varStore, size); + memcpy (dest, varStore, size_); return_trace (true); } - inline unsigned int get_size (void) const { return size; } + inline unsigned int get_size (void) const { return HBUINT16::static_size + size; } HBUINT16 size; VariationStore varStore;