Commit 94208055 authored by Ell's avatar Ell

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.)
parent 668fee96
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment