[subset] don't use pointers returned from push after array has resized in hb-subset-glyf.cc
This commit is contained in:
parent
3531efdb4c
commit
1396614040
|
@ -43,9 +43,14 @@ _calculate_glyf_and_loca_prime_size (const OT::glyf::accelerator_t &glyf,
|
||||||
for (unsigned int i = 0; i < glyph_ids.len; i++)
|
for (unsigned int i = 0; i < glyph_ids.len; i++)
|
||||||
{
|
{
|
||||||
hb_codepoint_t next_glyph = glyph_ids[i];
|
hb_codepoint_t next_glyph = glyph_ids[i];
|
||||||
unsigned int *instruction_start = instruction_ranges->push();
|
if (!instruction_ranges->resize (instruction_ranges->len + 2))
|
||||||
unsigned int *instruction_end = instruction_ranges->push();
|
{
|
||||||
|
DEBUG_MSG(SUBSET, nullptr, "Failed to resize instruction_ranges.", next_glyph);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
unsigned int *instruction_start = &(*instruction_ranges)[instruction_ranges->len - 2];
|
||||||
*instruction_start = 0;
|
*instruction_start = 0;
|
||||||
|
unsigned int *instruction_end = &(*instruction_ranges)[instruction_ranges->len - 1];
|
||||||
*instruction_end = 0;
|
*instruction_end = 0;
|
||||||
|
|
||||||
unsigned int start_offset, end_offset;
|
unsigned int start_offset, end_offset;
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue