After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 543085 - gdk_pixbuf_saturate_and_pixelate may corrupt memory
gdk_pixbuf_saturate_and_pixelate may corrupt memory
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Depends on:
Reported: 2008-07-15 11:55 UTC by Andrey Tsyvarev
Modified: 2010-07-10 04:06 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Andrey Tsyvarev 2008-07-15 11:55:57 UTC
When called with "saturation" = 1.0 and "pixelate" = FALSE, gdk_pixbuf_saturate_and_pixelate copies the contents of "src" to "dest" with memcpy (taking into account that the format, dimensions and rowstride values of the images are the same).

However images that do not occupy a contiguous memory block can not be copied in this way. Subpixbuf is a significant example of this case. A subpixbuf is a part of another image. When an image is copied into a subpixbuf via memcpy, not only the subpixbuf changes. The image surrounding the subpixbuf is changed too.

The detailed bug description can be found at:
Comment 1 Matthias Clasen 2008-07-15 20:36:04 UTC
Nice catch.

        * gdk-pixbuf-utils.c (gdk_pixbuf_saturate_and_pixelate):
        Use gdk_pixbuf_copy_area() to copy between pixbufs.
        Reported by Andrey Tsyvarev