[subset-cff] Pre-allocate values array for subroutines as well
This commit is contained in:
parent
c6279224db
commit
dc3bb5e0ed
|
@ -328,6 +328,8 @@ struct byte_str_ref_t
|
|||
void set_error () { str.backwards_length = str.length + 1; }
|
||||
bool in_error () const { return str.backwards_length > str.length; }
|
||||
|
||||
unsigned total_size () const { return str.length; }
|
||||
|
||||
protected:
|
||||
hb_ubytes_t str;
|
||||
};
|
||||
|
|
|
@ -442,8 +442,12 @@ struct subr_subset_param_t
|
|||
if (unlikely (calling && !parsed_str->is_parsed () && (parsed_str->values.length > 0)))
|
||||
env.set_error ();
|
||||
else
|
||||
{
|
||||
if (!parsed_str->is_parsed ())
|
||||
parsed_str->alloc (env.str_ref.total_size () / 2);
|
||||
current_parsed_str = parsed_str;
|
||||
}
|
||||
}
|
||||
|
||||
parsed_cs_str_t *current_parsed_str;
|
||||
|
||||
|
|
Loading…
Reference in New Issue