Reported on mailing list by Keith Stribley and Khaled Hosny.
unsigned int i; /* Cursor into ->info and ->pos arrays */
unsigned int len; /* Length of ->info and ->pos arrays */
- unsigned int out_len; /* Length of ->out array */
+ unsigned int out_len; /* Length of ->out array if have_output */
hb_glyph_info_t *info;
hb_glyph_info_t *out_info;
/* Methods */
+ inline unsigned int backtrack_len (void) const
+ { return this->have_output? this->out_len : this->i; }
inline unsigned int next_serial (void) { return serial++; }
inline void swap (void) { _hb_buffer_swap (this); }
inline void clear_output (void) { _hb_buffer_clear_output (this); }
unsigned int cluster_start,
unsigned int cluster_end)
{ _hb_buffer_set_masks (this, value, mask, cluster_start, cluster_end); }
-
};
*
* As an optimization, both info and out_info may point to the
* same piece of memory, which is owned by info. This remains the
- * case as long as out_len doesn't exceed len at any time.
+ * case as long as out_len doesn't exceed i at any time.
* In that case, swap() is no-op and the glyph operations operate
* mostly in-place.
*
match_func_t match_func,
const void *match_data)
{
- if (unlikely (c->buffer->out_len < count))
+ if (unlikely (c->buffer->backtrack_len () < count))
return false;
- for (unsigned int i = 0, j = c->buffer->out_len - 1; i < count; i++, j--)
+ for (unsigned int i = 0, j = c->buffer->backtrack_len () - 1; i < count; i++, j--)
{
while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->out_info[j], c->lookup_props, NULL))
{
ChainContextLookupContext &lookup_context)
{
/* First guess */
- if (unlikely (c->buffer->out_len < backtrackCount ||
+ if (unlikely (c->buffer->backtrack_len () < backtrackCount ||
c->buffer->i + inputCount + lookaheadCount > c->buffer->len ||
inputCount + lookaheadCount > c->context_length))
return false;