GNOME Bugzilla – Bug 318644
enforcement of displacement layer restrictions via PDB
Last modified: 2005-10-12 17:09:54 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:
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
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.
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
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.
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.