[subset] fix failure to init instruction ranges values for an invalid glyph.

This commit is contained in:
Garret Rieger 2019-01-18 16:41:08 -08:00
parent 4b1ac3a2fa
commit 96b038f375
1 changed files with 4 additions and 4 deletions

View File

@ -132,7 +132,7 @@ _calculate_glyf_and_loca_prime_size (const OT::glyf::accelerator_t &glyf,
glyf.remove_padding (start_offset, &end_offset))))
{
DEBUG_MSG(SUBSET, nullptr, "Invalid gid %d", next_glyph);
continue;
start_offset = end_offset = 0;
}
bool is_zero_length = end_offset - start_offset < OT::glyf::GlyphHeader::static_size;
@ -242,9 +242,9 @@ _write_glyf_and_loca_prime (const hb_subset_plan_t *plan,
if (glyf_prime_data_next + length > glyf_prime_data + glyf_prime_size)
{
DEBUG_MSG(SUBSET,
nullptr,
"WARNING: Attempted to write an out of bounds glyph entry for gid %d (length %d)",
i, length);
nullptr,
"WARNING: Attempted to write an out of bounds glyph entry for gid %d (length %d)",
i, length);
return false;
}