]> Pileus Git - ~andy/gtk/commitdiff
Use gdk_pixbuf_copy_area() to copy between pixbufs. Reported by Andrey
authorMatthias Clasen <matthiasc@src.gnome.org>
Tue, 15 Jul 2008 20:35:48 +0000 (20:35 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 15 Jul 2008 20:35:48 +0000 (20:35 +0000)
        * gdk-pixbuf-utils.c (gdk_pixbuf_saturate_and_pixelate):
        Use gdk_pixbuf_copy_area() to copy between pixbufs.
        Reported by Andrey Tsyvarev

svn path=/trunk/; revision=20840

gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-util.c

index 62ed4582c16bb4ef9a88a69ba4d9d351e6a4b595..d9ed0d27f2e5597b6fc4734ca5bb5d3b99aa35b1 100644 (file)
@@ -1,3 +1,11 @@
+2008-07-15  Matthias Clasen  <mclasen@redhat.com>
+
+       Bug 543085 – gdk_pixbuf_saturate_and_pixelate may corrupt memory
+
+       * gdk-pixbuf-utils.c (gdk_pixbuf_saturate_and_pixelate):
+       Use gdk_pixbuf_copy_area() to copy between pixbufs.
+       Reported by Andrey Tsyvarev
+
 2008-07-15  Matthias Clasen  <mclasen@redhat.com>
 
        * gdk-pixbuf-io.c: Move the check for wheter to use 
index 53e32403b17c445224fa99994c41203936cdef8b..f682aec9ba4bdb8bde426cb90824d7d07d9ee3ec 100644 (file)
@@ -190,9 +190,10 @@ gdk_pixbuf_saturate_and_pixelate(const GdkPixbuf *src,
   
         if (saturation == 1.0 && !pixelate) {
                 if (dest != src)
-                        memcpy (gdk_pixbuf_get_pixels (dest),
-                                gdk_pixbuf_get_pixels (src),
-                                gdk_pixbuf_get_height (src) * gdk_pixbuf_get_rowstride (src));
+                        gdk_pixbuf_copy_area (src, 0, 0, 
+                                              gdk_pixbuf_get_width (src),
+                                              gdk_pixbuf_get_height (src),
+                                              dest, 0, 0);
         } else {
                 int i, j, t;
                 int width, height, has_alpha, src_rowstride, dest_rowstride, bytes_per_pixel;