diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2008-07-15 20:35:48 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2008-07-15 20:35:48 +0000 |
commit | c70c74c9b86dc17f0baa10a889770ba31b51163d (patch) | |
tree | 64de4d20cd5bd1f11b6b6760236c1492a104918b /gdk-pixbuf | |
parent | 4946240780976497dc8ec0090d9db1235cb4532d (diff) | |
download | gdk-pixbuf-c70c74c9b86dc17f0baa10a889770ba31b51163d.tar.gz |
Use gdk_pixbuf_copy_area() to copy between pixbufs. Reported by Andrey
* 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
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/ChangeLog | 8 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-util.c | 7 |
2 files changed, 12 insertions, 3 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 62ed4582c..d9ed0d27f 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,5 +1,13 @@ 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 GIO for sniffing to configure. diff --git a/gdk-pixbuf/gdk-pixbuf-util.c b/gdk-pixbuf/gdk-pixbuf-util.c index 53e32403b..f682aec9b 100644 --- a/gdk-pixbuf/gdk-pixbuf-util.c +++ b/gdk-pixbuf/gdk-pixbuf-util.c @@ -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; |