diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2015-08-21 13:31:45 +0100 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2015-08-21 13:43:35 +0100 |
commit | cc3df43e9703cc4765358ae4e9e67c8199d5c37c (patch) | |
tree | 7435638f8ff978376f0537966c598c9c3788055b /pango/pango-layout.c | |
parent | 702e7cf1a336fed40bb2d89acc3c02b097c8bf84 (diff) | |
download | pango-cc3df43e9703cc4765358ae4e9e67c8199d5c37c.tar.gz |
Fix crasher in justify code
Ouch!
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r-- | pango/pango-layout.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index fa6fbc53..6d6e0c17 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -5243,11 +5243,14 @@ justify_clusters (PangoLayoutLine *line, /* distribute to before/after */ distribute_letter_spacing (adjustment, &space_left, &space_right); - glyphs->glyphs[i-1].geometry.width += space_left ; - glyphs->glyphs[i ].geometry.width += space_right; - glyphs->glyphs[i ].geometry.x_offset += space_right; - - added_so_far += adjustment; + if (i) + { + glyphs->glyphs[i-1].geometry.width += space_left ; + glyphs->glyphs[i ].geometry.width += space_right; + glyphs->glyphs[i ].geometry.x_offset += space_right; + + added_so_far += adjustment; + } } } } |