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.
pull/304/head
Behdad Esfahbod 8 years ago
parent 333173103b
commit 09c7a2d6bf
  1. 3
      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. */

Loading…
Cancel
Save