]> Pileus Git - ~andy/gtk/commitdiff
Check if depth of the source is not equal to the depth of the colormap
authorShivram U <shivaram.upadhyayula@wipro.com>
Fri, 26 Jul 2002 11:14:13 +0000 (11:14 +0000)
committerShivaram Upadhyayula <shivram_u@src.gnome.org>
Fri, 26 Jul 2002 11:14:13 +0000 (11:14 +0000)
Fri Jul 26 16:34:34 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. (#75597)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/gdkpixbuf-drawable.c

index 8bf745ff02f45ce8852b44c563b39ff93e24b29e..22b96e24ce9b248579f9d54a37477f3295468895 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Jul 26 16:34:34 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. (#75597)
+
 2002-07-25  Matthias Clasen  <maclas@gmx.de>
 
        * gdk/gdkrgb.c (gdk_rgb_select_conv): Use gdk_rgb_convert_4,
index 8bf745ff02f45ce8852b44c563b39ff93e24b29e..22b96e24ce9b248579f9d54a37477f3295468895 100644 (file)
@@ -1,3 +1,10 @@
+Fri Jul 26 16:34:34 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. (#75597)
+
 2002-07-25  Matthias Clasen  <maclas@gmx.de>
 
        * gdk/gdkrgb.c (gdk_rgb_select_conv): Use gdk_rgb_convert_4,
index 8bf745ff02f45ce8852b44c563b39ff93e24b29e..22b96e24ce9b248579f9d54a37477f3295468895 100644 (file)
@@ -1,3 +1,10 @@
+Fri Jul 26 16:34:34 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. (#75597)
+
 2002-07-25  Matthias Clasen  <maclas@gmx.de>
 
        * gdk/gdkrgb.c (gdk_rgb_select_conv): Use gdk_rgb_convert_4,
index 8bf745ff02f45ce8852b44c563b39ff93e24b29e..22b96e24ce9b248579f9d54a37477f3295468895 100644 (file)
@@ -1,3 +1,10 @@
+Fri Jul 26 16:34:34 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. (#75597)
+
 2002-07-25  Matthias Clasen  <maclas@gmx.de>
 
        * gdk/gdkrgb.c (gdk_rgb_select_conv): Use gdk_rgb_convert_4,
index 8bf745ff02f45ce8852b44c563b39ff93e24b29e..22b96e24ce9b248579f9d54a37477f3295468895 100644 (file)
@@ -1,3 +1,10 @@
+Fri Jul 26 16:34:34 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. (#75597)
+
 2002-07-25  Matthias Clasen  <maclas@gmx.de>
 
        * gdk/gdkrgb.c (gdk_rgb_select_conv): Use gdk_rgb_convert_4,
index 8bf745ff02f45ce8852b44c563b39ff93e24b29e..22b96e24ce9b248579f9d54a37477f3295468895 100644 (file)
@@ -1,3 +1,10 @@
+Fri Jul 26 16:34:34 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. (#75597)
+
 2002-07-25  Matthias Clasen  <maclas@gmx.de>
 
        * gdk/gdkrgb.c (gdk_rgb_select_conv): Use gdk_rgb_convert_4,
index ca25768aeb5a6ad84f0bf87f3fc257b8429096f2..ec7d650a7aa8f3226b0055b5ab77251a63ef05a4 100644 (file)
@@ -1218,6 +1218,14 @@ convert_real_slow (GdkImage    *image,
   bpl = image->bpl;
   v = gdk_colormap_get_visual(cmap);
 
+  if (image->depth != v->depth)
+    {
+      g_warning ("%s: The depth of the source image (%d) doesn't "
+                 "match the depth of the colormap passed in (%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,
@@ -1329,6 +1337,15 @@ rgbconvert (GdkImage    *image,
     }
   
   v = gdk_colormap_get_visual (cmap);
+
+  if (image->depth != v->depth)
+    {
+      g_warning ("%s: The depth of the source image (%d) doesn't "
+                 "match the depth of the colormap passed in (%d).",
+                 G_STRLOC, image->depth, v->depth);
+      return;
+    } 
   bank = 5; /* default fallback converter */
   index = (image->byte_order == GDK_MSB_FIRST) | (alpha != 0) << 1;
   
@@ -1515,6 +1532,14 @@ gdk_pixbuf_get_from_drawable (GdkPixbuf   *dest,
       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))
@@ -1623,6 +1648,14 @@ gdk_pixbuf_get_from_image (GdkPixbuf   *dest,
       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);