Skip to content

Off-by-one in ot_shape_normalize? #279

@simoncozens

Description

@simoncozens

I just noticed this:

// We are going to do a O(n^2). Only do this if the sequence is short.
if end - i <= MAX_COMBINING_MARKS {
buffer.sort(i, end, compare_combining_class);
if let Some(reorder_marks) = ctx.plan.shaper.reorder_marks {
reorder_marks(ctx.plan, buffer, i, end);
}
}
i = end + 1;

where harfbuzz has:

      /* We are going to do a O(n^2).  Only do this if the sequence is short. */
      if (end - i > HB_OT_SHAPE_MAX_COMBINING_MARKS) {
        i = end;
        continue;
      }


      buffer->sort (i, end, compare_combining_class);


      if (plan->shaper->reorder_marks)
        plan->shaper->reorder_marks (plan, buffer, i, end);


      i = end;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions