[subset] fix for name table serializing with new serializer machinery

This commit is contained in:
Behdad Esfahbod 2019-05-02 16:29:07 -07:00
parent c548fcedc4
commit 5ac4ab6868
2 changed files with 6 additions and 2 deletions

View File

@ -99,10 +99,12 @@ struct NameRecord
const void *src_base, const void *src_base,
const void *dst_base) const const void *dst_base) const
{ {
TRACE_SERIALIZE (this);
auto *out = c->embed (this); auto *out = c->embed (this);
out->offset = 0; if (unlikely (!out)) return_trace (nullptr);
out->offset.serialize_copy (c, src_base + offset, dst_base, length); out->offset.serialize_copy (c, src_base + offset, dst_base, length);
return out; return_trace (out);
} }
bool sanitize (hb_sanitize_context_t *c, const void *base) const bool sanitize (hb_sanitize_context_t *c, const void *base) const
@ -293,6 +295,8 @@ struct name
| hb_apply ([&] (unsigned _) { c->copy (src_array[_], src_base, dst_base); }) | hb_apply ([&] (unsigned _) { c->copy (src_array[_], src_base, dst_base); })
; ;
if (unlikely (c->ran_out_of_room)) return_trace (false);
assert (this->stringOffset == c->length ()); assert (this->stringOffset == c->length ());
return_trace (true); return_trace (true);

Binary file not shown.