From 96b038f375bcfcfdf76c75200ca02758ea7a4ff6 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Fri, 18 Jan 2019 16:41:08 -0800 Subject: [PATCH] [subset] fix failure to init instruction ranges values for an invalid glyph. --- src/hb-subset-glyf.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-subset-glyf.cc b/src/hb-subset-glyf.cc index 7b4344b..51608c9 100644 --- a/src/hb-subset-glyf.cc +++ b/src/hb-subset-glyf.cc @@ -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; } -- 2.7.4