diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 48f0a9dd66086742e27b3daa2e5abe740540ce5d..c8020d87ca77da66b94ca3032a1fb0c9e5dbff81 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -1311,7 +1311,7 @@ struct PosLookupSubTable inline bool can_use_fast_path (unsigned int lookup_type) const { /* Fast path, for those that have coverage in the same place. */ - return likely (lookup_type < Context) || + return likely (lookup_type && lookup_type < Context) || (hb_in_range (lookup_type, Context, ChainContext) && hb_in_range (u.header.sub_format, 1, 2)); } diff --git a/src/hb-ot-layout-gsub-table.hh b/src/hb-ot-layout-gsub-table.hh index e62be98a82077d284866ae0f00e0e1d8b476e25f..f5f38cc41de0e842666885e5ef5cdb03cb333a07 100644 --- a/src/hb-ot-layout-gsub-table.hh +++ b/src/hb-ot-layout-gsub-table.hh @@ -970,7 +970,7 @@ struct SubstLookupSubTable /* Fast path, for those that have coverage in the same place. * Note that ReverseChainSingle can also go through this but * it's not worth the effort. */ - return likely (lookup_type < Context) || + return likely (lookup_type && lookup_type < Context) || (hb_in_range (lookup_type, Context, ChainContext) && hb_in_range (u.header.sub_format, 1, 2)); } diff --git a/util/shape-consumer.hh b/util/shape-consumer.hh index 220daa497e455c0712b37a8e999c881fbe3e729c..11e4cc34a5096e615905306a86fc3dc907fc905a 100644 --- a/util/shape-consumer.hh +++ b/util/shape-consumer.hh @@ -49,6 +49,7 @@ struct shape_consumer_t { output.new_line (); + for (unsigned int i = 0; i < 10000; i++) { shaper.populate_buffer (buffer, text, text_len); output.consume_text (buffer, text, text_len, shaper.utf8_clusters); @@ -58,6 +59,7 @@ struct shape_consumer_t output.shape_failed (buffer, text, text_len, shaper.utf8_clusters); return; } + } output.consume_glyphs (buffer, text, text_len, shaper.utf8_clusters); }