[gimp] app: gimp_layer_new_from_pixbuf(): refuse to create layers of wrong type



commit 92ce59e1c1846bdc15d7136fc5e3e72bb5b76232
Author: Michael Natterer <mitch gimp org>
Date:   Thu Apr 28 01:27:04 2011 +0200

    app: gimp_layer_new_from_pixbuf(): refuse to create layers of wrong type

 app/core/gimplayer.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index 3d46685..783598a 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -1208,6 +1208,8 @@ gimp_layer_new_from_pixbuf (GdkPixbuf            *pixbuf,
 
   g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
   g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL);
+  g_return_val_if_fail (GIMP_IMAGE_TYPE_BASE_TYPE (type) ==
+                        gimp_image_base_type (dest_image), NULL);
 
   pixel_region_init_data (&bufPR, gdk_pixbuf_get_pixels (pixbuf),
                           gdk_pixbuf_get_n_channels (pixbuf),



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