Commit b585201e authored by Jehan's avatar Jehan

Issue #1723: gih file that crashes gimp-2.10.

The flag `free_selection_string` is used to track an array of strings
with some of them being static and others allocated. This should have
been an array of boolean but we can't change it because it is public API
(though it should really not have been!).

So let's just allocate every string of the `selection` array instead,
which makes the boolean flag useless now.
parent 6580fae7
......@@ -156,7 +156,6 @@ gimp_brush_pipe_load (GimpContext *context,
pipe->select[i] = PIPE_SELECT_TILT_Y;
else
pipe->select[i] = PIPE_SELECT_CONSTANT;
if (params.free_selection_string)
g_free (params.selection[i]);
pipe->index[i] = 0;
}
......
......@@ -64,10 +64,7 @@ gimp_pixpipe_params_init (GimpPixPipeParams *params)
params->placement = "constant";
params->free_placement_string = FALSE;
for (i = 0; i < GIMP_PIXPIPE_MAXDIM; i++)
{
params->selection[i] = "random";
params->free_selection_string = FALSE;
}
params->selection[i] = g_strdup ("random");
params->rank[0] = 1;
for (i = 1; i < GIMP_PIXPIPE_MAXDIM; i++)
params->rank[i] = 0;
......@@ -156,8 +153,8 @@ gimp_pixpipe_params_parse (const gchar *string,
i = atoi (p + strlen ("sel"));
if (i >= 0 && i < params->dim)
{
g_free (params->selection[i]);
params->selection[i] = g_strdup (r + 1);
params->free_selection_string = TRUE;
}
}
}
......
......@@ -53,6 +53,7 @@ struct _GimpPixPipeParams
gboolean free_placement_string;
gint rank[GIMP_PIXPIPE_MAXDIM];
gchar *selection[GIMP_PIXPIPE_MAXDIM];
/* this flag is now useless. All selection strings are allocated. */
gboolean free_selection_string;
};
......
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