[gtk+] pango: Handle case where pango_layout_get_text() returns NULL



commit 70ac2b24c3d400c854d8a9e0937afa076f9dbe7f
Author: Benjamin Otte <otte redhat com>
Date:   Mon Sep 9 16:50:55 2013 +0200

    pango: Handle case where pango_layout_get_text() returns NULL
    
    Fixes crashers with accessibility
    
    https://bugzilla.gnome.org/show_bug.cgi?id=707659

 gtk/gtkpango.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkpango.c b/gtk/gtkpango.c
index 40c94f3..ea688ea 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]