mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-21 23:11:04 +01:00
[subset-cff] Pre-allocate values array for subroutines as well
This commit is contained in:
1 parent
c6279224db
commit
dc3bb5e0ed
2 files changed
+6
No files matched your search
@@ -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,7 +442,11 @@ 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;
|
||||
|
||||
Reference in new issue
Block a user