summaryrefslogtreecommitdiff
path: root/pango/pango-layout.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2015-08-21 13:31:45 +0100
committerBehdad Esfahbod <behdad@behdad.org>2015-08-21 13:43:35 +0100
commitcc3df43e9703cc4765358ae4e9e67c8199d5c37c (patch)
tree7435638f8ff978376f0537966c598c9c3788055b /pango/pango-layout.c
parent702e7cf1a336fed40bb2d89acc3c02b097c8bf84 (diff)
downloadpango-cc3df43e9703cc4765358ae4e9e67c8199d5c37c.tar.gz
Fix crasher in justify code
Ouch!
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r--pango/pango-layout.c13
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;
+ }
}
}
}