summaryrefslogtreecommitdiff
path: root/pango/pango-layout.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-12-09 14:26:25 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-12-09 14:30:18 -0500
commit3bb2249f3452061247655a11696a93dc5eeae584 (patch)
treebb99d420b438d16a588923b9a8d96819302bffba /pango/pango-layout.c
parentea2fa51616df5a23cd97f2cc8460a608722666c9 (diff)
downloadpango-3bb2249f3452061247655a11696a93dc5eeae584.tar.gz
layout: Handle a corner case
We can't break in a tab run. This fixes an assertion found by afl. Testcase included. Fixes: #638
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r--pango/pango-layout.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index a495596c..a3f8b552 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -4496,12 +4496,14 @@ process_line (PangoLayout *layout,
switch (result)
{
case BREAK_ALL_FIT:
- if (can_break_in (layout, state->start_offset, old_num_chars, first_item_in_line))
+ if (layout->text[item->offset] != '\t' &&
+ can_break_in (layout, state->start_offset, old_num_chars, first_item_in_line))
{
have_break = TRUE;
break_remaining_width = old_remaining_width;
break_start_offset = state->start_offset;
break_link = line->runs->next;
+ DEBUG1 ("all-fit, have break");
}
state->items = g_list_delete_link (state->items, state->items);