summaryrefslogtreecommitdiff
path: root/gtk/gtkpango.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2013-09-09 16:50:55 +0200
committerBenjamin Otte <otte@redhat.com>2013-09-09 16:53:13 +0200
commit70ac2b24c3d400c854d8a9e0937afa076f9dbe7f (patch)
tree284e92a41e4464a3f03893bdafb91f212b80a671 /gtk/gtkpango.c
parent92edb7650086e1ec55b804a7d8032f220c740757 (diff)
downloadgtk+-70ac2b24c3d400c854d8a9e0937afa076f9dbe7f.tar.gz
pango: Handle case where pango_layout_get_text() returns NULL
Fixes crashers with accessibility https://bugzilla.gnome.org/show_bug.cgi?id=707659
Diffstat (limited to 'gtk/gtkpango.c')
-rw-r--r--gtk/gtkpango.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gtk/gtkpango.c b/gtk/gtkpango.c
index 40c94f3c13..ea688eaf8d 100644
--- a/gtk/gtkpango.c
+++ b/gtk/gtkpango.c
@@ -1014,7 +1014,7 @@ _gtk_pango_get_text_before (PangoLayout *layout,
text = pango_layout_get_text (layout);
- if (text[0] == 0)
+ if (text == NULL || text[0] == 0)
{
*start_offset = 0;
*end_offset = 0;
@@ -1115,7 +1115,7 @@ _gtk_pango_get_text_after (PangoLayout *layout,
text = pango_layout_get_text (layout);
- if (text[0] == 0)
+ if (text == NULL || text[0] == 0)
{
*start_offset = 0;
*end_offset = 0;
@@ -1222,7 +1222,7 @@ _gtk_pango_get_text_at (PangoLayout *layout,
text = pango_layout_get_text (layout);
- if (text[0] == 0)
+ if (text == NULL || text[0] == 0)
{
*start_offset = 0;
*end_offset = 0;