Commit 8f7c1ed6 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Avoid an out-of-bound access

We can only use the width of the previous char
if we are not at the first char. Found by asan.
parent 2bd2a6b9
Pipeline #337172 passed with stages
in 8 minutes and 35 seconds
......@@ -3750,7 +3750,7 @@ find_break_extra_width (PangoLayout *layout,
ensure_hyphen_width (state);
if (layout->log_attrs[state->start_offset + pos].break_removes_preceding)
if (layout->log_attrs[state->start_offset + pos].break_removes_preceding && pos > 0)
return state->hyphen_width - state->log_widths[state->log_widths_offset + pos - 1];
return state->hyphen_width;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment