[gtk+/gtk-style-context] GtkStyle: Protect against padding being NULL



commit ebfeafdf452deefe3ed3f8f0c313ee17d7b68206
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Sep 11 12:10:50 2010 +0200

    GtkStyle: Protect against padding being NULL

 gtk/gtkstyle.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index 07415fb..bd22898 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -729,10 +729,13 @@ gtk_style_update_from_context (GtkStyle *style)
                          "padding", &padding,
                          NULL);
 
-  style->xthickness = padding->left;
-  style->ythickness = padding->top;
+  if (padding)
+    {
+      style->xthickness = padding->left;
+      style->ythickness = padding->top;
 
-  gtk_border_free (padding);
+      gtk_border_free (padding);
+    }
 }
 
 static void



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