[gtk+] border-image: don't try to unpack values from a NULL border-image
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] border-image: don't try to unpack values from a NULL border-image
- Date: Thu, 9 Jun 2011 19:06:24 +0000 (UTC)
commit 42d7487a6ed2aa041b35110725f5768b092cd976
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Jun 9 14:54:00 2011 -0400
border-image: don't try to unpack values from a NULL border-image
NULL is a valid value for border-image, so if it's NULL when unpacking,
don't try to access the struct fields, but just init the GValues for the
unpacked parameters.
gtk/gtkborderimage.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkborderimage.c b/gtk/gtkborderimage.c
index 2770078..b6cf778 100644
--- a/gtk/gtkborderimage.c
+++ b/gtk/gtkborderimage.c
@@ -139,15 +139,19 @@ _gtk_border_image_unpack (const GValue *value,
parameter[0].name = "border-image-source";
g_value_init (¶meter[0].value, CAIRO_GOBJECT_TYPE_PATTERN);
- g_value_set_boxed (¶meter[0].value, image->source);
parameter[1].name = "border-image-slice";
g_value_init (¶meter[1].value, GTK_TYPE_BORDER);
- g_value_set_boxed (¶meter[1].value, &image->slice);
parameter[2].name = "border-image-repeat";
g_value_init (¶meter[2].value, GTK_TYPE_CSS_BORDER_IMAGE_REPEAT);
- g_value_set_boxed (¶meter[2].value, &image->repeat);
+
+ if (image != NULL)
+ {
+ g_value_set_boxed (¶meter[0].value, image->source);
+ g_value_set_boxed (¶meter[1].value, &image->slice);
+ g_value_set_boxed (¶meter[2].value, &image->repeat);
+ }
*n_params = 3;
return parameter;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]