Commit 46c91ebc authored by Martin Nordholts's avatar Martin Nordholts Committed by Sven Neumann

Bug 604078 - Crash when pressing Backspace with Free Select Tool

Make sure we never call gimp_free_select_tool_remove_last_segment()
with priv->n_segment_indices being negative, and increase robustness
of the code in general.

Note that we always halt the tool when backspace is pressed and there
are no vertices left. This is to minimize the risk of ending up in an
invalid tool state.
(cherry picked from commit c7a5195b)
parent df956417
......@@ -484,9 +484,10 @@ gimp_free_select_tool_remove_last_segment (GimpFreeSelectTool *fst)
gimp_draw_tool_pause (draw_tool);
priv->n_segment_indices--;
if (priv->n_segment_indices > 0)
priv->n_segment_indices--;
if (priv->n_segment_indices == 0)
if (priv->n_segment_indices <= 0)
{
gimp_free_select_tool_halt (fst);
}
......
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