From: Behdad Esfahbod Date: Tue, 9 Aug 2016 00:28:54 +0000 (-0700) Subject: Limit bits-per-feature to eight X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09c7a2d6bf00dc902343e999f92cac0e8146f949;p=platform%2Fupstream%2FlibHarfBuzzSharp.git Limit bits-per-feature to eight Limits number of alternatives per glyph per feature to 255, so be it. That's better than possibly breaking shaping because of one bad feature value. --- diff --git a/src/hb-ot-map.cc b/src/hb-ot-map.cc index 35550af..17e3f40 100644 --- a/src/hb-ot-map.cc +++ b/src/hb-ot-map.cc @@ -193,7 +193,8 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m) /* Uses the global bit */ bits_needed = 0; else - bits_needed = _hb_bit_storage (info->max_value); + /* Limit to 8 bits per feature. */ + bits_needed = MIN(8u, _hb_bit_storage (info->max_value)); if (!info->max_value || next_bit + bits_needed > 8 * sizeof (hb_mask_t)) continue; /* Feature disabled, or not enough bits. */