summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
authorRob Adams <robadams@ucla.edu>2003-08-30 01:48:31 +0000
committerRob Adams <readams@src.gnome.org>2003-08-30 01:48:31 +0000
commit9ddacb019e32ec01eb25dc9d252ec79fdfd1f622 (patch)
tree7ea0d5bd0c6a504939745f74a8235fd8289a56dd /src/ui.c
parenta4a32a54c3b29bd3eed42bb7279b268b62de67c4 (diff)
downloadmetacity-9ddacb019e32ec01eb25dc9d252ec79fdfd1f622.tar.gz
harden against null return from gdk_pixmap_foreign_new. Fix for #116923.
2003-08-29 Rob Adams <robadams@ucla.edu> * src/ui.c (meta_gdk_pixbuf_get_from_pixmap): harden against null return from gdk_pixmap_foreign_new. Fix for #116923.
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/ui.c b/src/ui.c
index 1f53c3b1..e4c5bcbc 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -523,18 +523,21 @@ meta_gdk_pixbuf_get_from_pixmap (GdkPixbuf *dest,
else
drawable = gdk_pixmap_foreign_new (xpixmap);
- cmap = get_cmap (drawable);
+ if (drawable)
+ {
+ cmap = get_cmap (drawable);
- retval = gdk_pixbuf_get_from_drawable (dest,
- drawable,
- cmap,
- src_x, src_y,
- dest_x, dest_y,
- width, height);
-
+ retval = gdk_pixbuf_get_from_drawable (dest,
+ drawable,
+ cmap,
+ src_x, src_y,
+ dest_x, dest_y,
+ width, height);
+ }
if (cmap)
g_object_unref (G_OBJECT (cmap));
- g_object_unref (G_OBJECT (drawable));
+ if (drawable)
+ g_object_unref (G_OBJECT (drawable));
return retval;
}