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 110078 - Compositing pixbufs causes segfault
Compositing pixbufs causes segfault
Status: RESOLVED NOTABUG
Product: gdk-pixbuf
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2003-04-05 23:46 UTC by Jussi Pakkanen
Modified: 2010-07-10 04:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example code demonstrating the segfault (635 bytes, text/plain)
2003-04-05 23:48 UTC, Jussi Pakkanen
Details
composite_gtk.c (1008 bytes, text/plain)
2003-05-19 05:39 UTC, Murray Cumming
Details

Description Jussi Pakkanen 2003-04-05 23:46:01 UTC
In my program I create pixbufs to be shown by composing it from several
smaller pixbufs. Sometimes the composite command bombs out with segment
violation.

I'll attach a small test case demonstrating the bug. In it I create two
pixbufs, one sized 64x128, the other 64x64. Compositing the small pixbuf on
the bottom half of the bigger pixbuf causes segfault.
Comment 1 Jussi Pakkanen 2003-04-05 23:48:36 UTC
Created attachment 15501 [details]
Example code demonstrating the segfault
Comment 2 Murray Cumming 2003-04-07 09:05:30 UTC
Do you know if this works in C? Does composite() allocate new memory
or do you need to allocate enough yourself?
Comment 3 Jussi Pakkanen 2003-04-07 10:35:18 UTC
I don't know if it works in C or not. I have never coded with plain
GTK, only gtkmm.

Composite just draws the source image over the target image, which
must both be preallocated (as they are in the example). If you try to
draw outside the target image, you get a failed assertion. The example
does not get this message (so the composition command should be
valid), it just crashes.
Comment 4 Murray Cumming 2003-05-19 05:39:22 UTC
Created attachment 16619 [details]
composite_gtk.c
Comment 5 Murray Cumming 2003-05-19 05:42:21 UTC
I have recoded this as C and it still has the same problem - the
composite_gtk.c attachment. I don't know whether it's a true bug
because I don't know how this is really supposed to work. I'm
reassigning this to GTK+ - if you don't get a response then mention
this bug on their gtk-list@gnome.org mailing list.
Comment 6 Matthias Clasen 2003-05-19 07:43:12 UTC
From a quick glance at the C testcase, your destination rectangle (0, 
64, 64, 64) is outside of the transformed source image (0, 0, 64, 64).


In order to achieve what you want, you'll have to use an offset_y of 
64, in order to get the transformed image to (0, 64, 64, 64).




We probably should catch this mistake with a g_return_if_fail() and I 
think there is another gdk-pixbuf bug which already has a patch for 
that... 




Please reopen if my analysis is wrong.
Comment 7 Murray Cumming 2003-05-23 07:58:51 UTC
Thanks Matthias.