GNOME Bugzilla – Bug 165372
Unsharp Mask crashes with a certain image & selection
Last modified: 2008-01-15 12:46:37 UTC
Please describe the problem: From Debian bug report http://bugs.debian.org/292119 The file EuropeanParliament.xcf.bz2 located at http://people.debian.org/~tille/tmp/ has a region selected. Without changing the region, select the Unsharp Mask filter. The dialog pops up but immediately exits, with the following printed on stderr: (unsharp:15543): LibGimp-CRITICAL **: file gimppixelrgn.c: line 137 (gimp_pixel_rgn_init): assertion `x >= 0 && x + width <= drawable->width' failed (unsharp:15543): LibGimp-CRITICAL **: file gimppixelrgn.c: line 381 (gimp_pixel_rgn_get_rect): assertion `x >= 0 && x + width <= pr->drawable->width' failed (unsharp:15543): LibGimp-CRITICAL **: file gimppixelrgn.c: line 138 (gimp_pixel_rgn_init): assertion `y >= 0 && y + height <= drawable->height' failed /usr/lib/gimp/2.0/plug-ins/unsharp: fatal error: Segmentation fault Apparently this operation works fine under gimp 2.0.6. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
I can't reproduce this with 2.2.3 on Win32. The Debian bug you're linking to doesn't seem to be related, too.
It looks like the correct Debian bug report is: http://bugs.debian.org/292199
I can reproduce the warnings. It doesn't crash for me but there must not be such warnings, so we definitely need to fix this.
Confirmed for current cvs. The problem is in the preview code -- in this image, the layer being operated on extends to the right and above the image boundaries. The line gimp_pixel_rgn_init (&selection_rgn, gimp_drawable_get (selection_id), x + offset_x, y + offset_y, width, height, FALSE, FALSE); from gimp_drawable_preview_draw_area() in gimpdrawablepreview.c (line 281) is failing because initially x=0, y=0, offset_x=-2, offset_y=-2.
Created attachment 36612 [details] [review] patch for libgimp/gimpdrawablepreview.c This fixes it for me, and looks like the right thing to do.
Bill, please try to be a little more careful with Bugzilla. You probably didn't mean to remove the 2.2 milestone. Patch looks good to me, please apply it.
My comment #4 collided with your comment #3. Not realizing that you had done anything other than make a comment, and not wanting to write mine all over again, I confirmed that I wanted to submit the comment anyway -- that's how the milestone got changed, I think. For future collisions, I'll try to be alert to this possibility.
Hint: modern browsers let the content of textareas survive reloads - and there is cut&paste.
Okay, committed to both branches. 2005-01-28 Bill Skaggs <weskaggs@primate.ucdavis.edu> * libgimp/gimpdrawablepreview.c: set preview bounds correctly when previewed drawable extends beyond image edges, fixes bug #165372.