1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 01:12:40 +02:00

tools: Fix crash in passthrough composited preview

Resolves #13087
We use gimp_layer_get_effective_mode () to retrieve
a simplified layer mode for optimization purposes
(e.g. if it's effectively NORMAL, we can do less processing).
GimpTransformGridTool used this function when the user
requests Composited Preview to only apply transforms to
individual layers in a group if absolutely necessary.
This means that sometimes, it returns NORMAL instead of
PASS_THROUGH depending on the number and types of
layers in the group.

Since 71aff497, when we remove a filter we also update the
effective mode of the group layer. However, this leads to an
infinite loop scenario where the effective mode change causes
the TransformGridTool to repeatedly remove and add a filter
until GIMP crashes.

This patch changes the gimp_transform_grid_tool_add_filter ()
check to always get the actual mode rather than the effective mode.
This prevents the effective mode change from causing an infinite loop,
but does mean that we now always apply transforms to all layers of the
group even if the composite preview would work fine.
This commit is contained in:
Alx Sa
2025-08-15 06:03:13 +00:00
parent aa9aa9e489
commit ede124ff85

View File

@@ -1909,10 +1909,7 @@ gimp_transform_grid_tool_add_filter (GimpDrawable *drawable,
GimpLayerMode mode = GIMP_LAYER_MODE_NORMAL;
if (GIMP_IS_LAYER (drawable))
{
gimp_layer_get_effective_mode (GIMP_LAYER (drawable),
&mode, NULL, NULL, NULL);
}
mode = gimp_layer_get_mode (GIMP_LAYER (drawable));
if (mode != GIMP_LAYER_MODE_PASS_THROUGH)
{