summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2013-12-15 18:42:17 -0500
committerBehdad Esfahbod <behdad@behdad.org>2013-12-15 18:42:46 -0500
commita6c318ee505aeabe6f84e1543d68834b9e0e7acf (patch)
tree003d3e8ed4dc6d1aaa98e8a695fc7b3f42754d92
parentf9c83d3e0ec5d086fca6495a7e9aac7fbae1f9ca (diff)
downloadpango-a6c318ee505aeabe6f84e1543d68834b9e0e7acf.tar.gz
Bug 720379 - SIGFPE in pango_layout_iter_get_char_extents()
Untested.
-rw-r--r--pango/pango-layout.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index a024d11b..607a5f0e 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -6178,8 +6178,15 @@ pango_layout_iter_get_char_extents (PangoLayoutIter *iter,
return;
}
- x0 = (iter->character_position * cluster_rect.width) / iter->cluster_num_chars;
- x1 = ((iter->character_position + 1) * cluster_rect.width) / iter->cluster_num_chars;
+ if (iter->cluster_num_chars)
+ {
+ x0 = (iter->character_position * cluster_rect.width) / iter->cluster_num_chars;
+ x1 = ((iter->character_position + 1) * cluster_rect.width) / iter->cluster_num_chars;
+ }
+ else
+ {
+ x0 = x1 = 0;
+ }
logical_rect->width = x1 - x0;
logical_rect->height = cluster_rect.height;