mirror of https://github.com/GNOME/gimp.git
Issue 2052 - Crash when using the flip tool
In gimp_transform_tool_transform(), use "active_item", instead of "tool->drawable", when cutting/pasting the selected portion of a layer for transformation. The latter is a remnant of the old transform-tool code, and is not guaranteed to be correspond to the correct drawable, or even to a valid drawable (i.e., it can potentially produce wrong results, or segfault.)
This commit is contained in:
parent
668fee966a
commit
9420805525
|
@ -462,10 +462,10 @@ gimp_transform_tool_transform (GimpTransformTool *tr_tool,
|
|||
switch (options->type)
|
||||
{
|
||||
case GIMP_TRANSFORM_TYPE_LAYER:
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (tool->drawable)) &&
|
||||
if (! gimp_viewable_get_children (GIMP_VIEWABLE (active_item)) &&
|
||||
! gimp_channel_is_empty (gimp_image_get_mask (image)))
|
||||
{
|
||||
orig_buffer = gimp_drawable_transform_cut (tool->drawable,
|
||||
orig_buffer = gimp_drawable_transform_cut (GIMP_DRAWABLE (active_item),
|
||||
context,
|
||||
&orig_offset_x,
|
||||
&orig_offset_y,
|
||||
|
@ -503,7 +503,7 @@ gimp_transform_tool_transform (GimpTransformTool *tr_tool,
|
|||
/* paste the new transformed image to the image...also implement
|
||||
* undo...
|
||||
*/
|
||||
gimp_drawable_transform_paste (tool->drawable,
|
||||
gimp_drawable_transform_paste (GIMP_DRAWABLE (active_item),
|
||||
new_buffer, buffer_profile,
|
||||
new_offset_x, new_offset_y,
|
||||
new_layer);
|
||||
|
|
Loading…
Reference in New Issue