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 348222 - gtk_pixbuf_scale* () eat memory when resizing to 1x1 and 2x2
gtk_pixbuf_scale* () eat memory when resizing to 1x1 and 2x2
Status: RESOLVED DUPLICATE of bug 80925
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 348170 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-07-21 09:57 UTC by Fabio Bonelli
Modified: 2010-07-10 04:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16



Description Fabio Bonelli 2006-07-21 09:57:47 UTC
gtk_pixbuf_scale_simple () can kill a machine with 512MiB of RAM (like mine) using a 1024x768 PNG and resizing it to 1x1. A 1152x864 PNG will kill a 1GiB machine too.

Test case:

/* gcc -o gdk-pixbuf-scale $(pkg-config --cflags --libs gtk+-2.0) gdk-pixbuf-scale.c */
#include <stdlib.h>
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

int main ()
{
        GtkWidget *image;
        GdkPixbuf *pixbuf;

        gtk_init (NULL, NULL);

        image = gtk_image_new_from_file ("800x600image.png");
        g_assert (image != NULL);

        pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (image));
        g_assert (pixbuf != NULL);

        gdk_pixbuf_scale_simple (pixbuf, 1, 1, GDK_INTERP_BILINEAR);

        return EXIT_SUCCESS;
}
Comment 1 Bastien Nocera 2006-07-21 10:18:34 UTC
*** Bug 348170 has been marked as a duplicate of this bug. ***
Comment 2 Owen Taylor 2006-07-21 11:35:05 UTC

*** This bug has been marked as a duplicate of 80925 ***