Index: gtk+/ChangeLog
===================================================================
RCS file: /export/cvs/gnome-2.0/gtk+/ChangeLog,v
retrieving revision 1.53
diff -p -u -5 -r1.53 ChangeLog
--- gtk+/ChangeLog	2002/05/13 10:22:20	1.53
+++ gtk+/ChangeLog	2002/05/16 09:57:09
@@ -1,5 +1,12 @@
+Thu May 16  15:52:23 2002  Shivram U  <shivaram.upadhyayula@wipro.com>
+
+	* gdk/gdkpixbuf-drawable.c (gdk_pixbuf_get_from_drawable),
+	(gdk_pixbuf_get_from_image), (rgbconvert), (convert_real_slow):
+	Check if depth of the source is not equal to the depth of the colormap
+	passed. Fix for #75597.
+
 2002-05-10  Daniel Elstner  <daniel.elstner@gmx.net>
 
 	[ merge from stable ]
 
 	* gtk/gtktreemodel.c: #define INITIALIZE_TREE_ITER(),
Index: gtk+/gdk/gdkpixbuf-drawable.c
===================================================================
RCS file: /export/cvs/gnome-2.0/gtk+/gdk/gdkpixbuf-drawable.c,v
retrieving revision 1.3
diff -p -u -5 -r1.3 gdkpixbuf-drawable.c
--- gtk+/gdk/gdkpixbuf-drawable.c	2002/04/26 21:23:42	1.3
+++ gtk+/gdk/gdkpixbuf-drawable.c	2002/05/16 10:10:01
@@ -1215,10 +1215,18 @@ convert_real_slow (GdkImage    *image,
   int i;
 
   bpl = image->bpl;
   v = gdk_colormap_get_visual(cmap);
 
+  if (image->depth != v->depth)
+    {
+      g_warning ("%s: Depth of the Source image is %d where as "
+                 "the visual depth of the colormap passed is %d",
+                 G_STRLOC, image->depth, v->depth);
+      return;
+    } 
+ 
   d(printf("rgb  mask/shift/prec = %x:%x:%x %d:%d:%d  %d:%d:%d\n",
 	   v->red_mask, v->green_mask, v->blue_mask,
 	   v->red_shift, v->green_shift, v->blue_shift,
 	   v->red_prec, v->green_prec, v->blue_prec));
 
@@ -1326,10 +1334,19 @@ rgbconvert (GdkImage    *image,
       
       return;
     }
   
   v = gdk_colormap_get_visual (cmap);
+
+  if (image->depth != v->depth)
+    {
+      g_warning ("%s: Depth of the Source image is %d where as "
+                 "the visual depth of the colormap passed is %d",
+                 G_STRLOC, image->depth, v->depth);
+      return;
+    } 
+ 
   bank = 5; /* default fallback converter */
   index = (image->byte_order == GDK_MSB_FIRST) | (alpha != 0) << 1;
   
   d(printf("masks = %x:%x:%x\n", v->red_mask, v->green_mask, v->blue_mask));
   d(printf("image depth = %d, bits per pixel = %d\n", image->depth, image->bits_per_pixel));
@@ -1512,10 +1529,18 @@ gdk_pixbuf_get_from_drawable (GdkPixbuf 
                  "in a colormap, or set the colormap on the drawable "
                  "with gdk_drawable_set_colormap()", G_STRLOC);
       return NULL;
     }
   
+  if (cmap != NULL && depth != cmap->visual->depth)
+    {
+      g_warning ("%s: Depth of the source drawable is %d where as "
+                 "the visual depth of the colormap passed is %d",
+                 G_STRLOC, depth, cmap->visual->depth);
+      return NULL;
+    } 
+ 
   /* Coordinate sanity checks */
   
   if (GDK_IS_PIXMAP (src))
     {
       gdk_drawable_get_size (src, &src_width, &src_height);
@@ -1620,10 +1645,18 @@ gdk_pixbuf_get_from_image (GdkPixbuf   *
                  "in a colormap, or set the colormap on the image "
                  "with gdk_image_set_colormap()", G_STRLOC);
       return NULL;
     }
   
+  if (cmap != NULL && src->depth != cmap->visual->depth)
+    {
+      g_warning ("%s: Depth of the Source image is %d where as "
+                 "the visual depth of the colormap passed is %d",
+                 G_STRLOC, src->depth, cmap->visual->depth);
+      return NULL;
+    } 
+ 
   /* Coordinate sanity checks */
 
   g_return_val_if_fail (src_x >= 0 && src_y >= 0, NULL);
   g_return_val_if_fail (src_x + width <= src->width && src_y + height <= src->height, NULL);
 
