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 318644 - enforcement of displacement layer restrictions via PDB
enforcement of displacement layer restrictions via PDB
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
git master
Other Linux
: Normal minor
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2005-10-12 07:12 UTC by Carol
Modified: 2005-10-12 17:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a perl script that will crash gimp (2.17 KB, text/plain)
2005-10-12 07:16 UTC, Carol
Details
the same script only fixed (2.20 KB, text/plain)
2005-10-12 07:18 UTC, Carol
Details
an xcf that will produce the bug with the broken script (2.83 KB, application/x-compressed-tar)
2005-10-12 07:22 UTC, Carol
Details

Description Carol 2005-10-12 07:12:27 UTC
Distribution/Version: debian sid/experimental

When used through the gui, the displacement plug-in restricts x and y
displacement values to the image width and height, however when called via a
script the displacement plug-in allows values that will crash gimp.

The gimp-perl plug-in scratches shows how this happens.  The error you get when
running the plug-in on a layer that is larger than the image is this:
(displace:6248): LibGimp-CRITICAL **: gimp_pixel_rgn_init: assertion `y >= 0 &&
y + height <= drawable->height' failed

(displace:6248): LibGimp-CRITICAL **: gimp_pixel_rgn_init: assertion `y >= 0 &&
y + height <= drawable->height' failed
/usr/local/lib/gimp/2.0/plug-ins/displace: fatal error: Segmentation fault
/usr/local/lib/gimp/2.0/plug-ins/displace (pid:6248): [E]xit, [H]alt, show
[S]tack trace or [P]roceed:
Comment 1 Carol 2005-10-12 07:16:27 UTC
Created attachment 53354 [details]
a perl script that will crash gimp

I changed it so that it will register itself as
<Image>Filters-->Distorts-->Scratches-broken
Comment 2 Carol 2005-10-12 07:18:16 UTC
Created attachment 53355 [details]
the same script only fixed

This is a fixed version of the script.	Better for the pdb interface to not
accept the values to begin with.
Comment 3 Carol 2005-10-12 07:22:29 UTC
Created attachment 53356 [details]
an xcf that will produce the bug with the broken script

This image will crash gimp.  It can also be found online:
http://carol.gimp.org/files/gimp-perl_displace-Critical.xcf.gz
Comment 4 Sven Neumann 2005-10-12 17:00:05 UTC
The point is that the plug-in accepts displacement maps that are not of the same
size as the drawable it is working on. The GUI enforces this constraint but the
PDB doesn't.
Comment 5 Sven Neumann 2005-10-12 17:09:54 UTC
2005-10-12  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/displace.c: check that displacement maps have
	the same size as the target drawable, return a PDB_CALLING_ERROR
	otherwise. Fixes bug #318644.