Commit f4b390a4 authored by Simon Budig's avatar Simon Budig Committed by Simon Budig

app/core/gimpimage-mask-select.c Fixed two crashes when a path with a

2003-08-28  Simon Budig  <simon@gimp.org>

	* app/core/gimpimage-mask-select.c
	* app/vectors/gimpbezierstroke.c: Fixed two crashes when a path
	with a single node in a stroke got converted to a selection or got
	stroked.
parent 6bcd478d
2003-08-28 Simon Budig <simon@gimp.org>
* app/core/gimpimage-mask-select.c
* app/vectors/gimpbezierstroke.c: Fixed two crashes when a path
with a single node in a stroke got converted to a selection or got
stroked.
2003-08-28 Sven Neumann <sven@gimp.org>
* app/core/gimpcontext.c (gimp_context_real_set_foreground)
......@@ -197,11 +197,12 @@ gimp_image_mask_select_vectors (GimpImage *gimage,
GList *stroke;
GArray *coords = NULL;
gboolean closed;
gint num_coords=0;
const gchar *undo_name = "Select Vectors"; /* this probably should be an
argument */
GimpScanConvert *scan_convert;
GimpChannel *mask;
GimpChannel *mask = NULL;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
......@@ -237,6 +238,7 @@ gimp_image_mask_select_vectors (GimpImage *gimage,
{
points[i].x = g_array_index (coords, GimpCoords, i).x;
points[i].y = g_array_index (coords, GimpCoords, i).y;
num_coords++;
}
gimp_scan_convert_add_points (scan_convert, coords->len,
......@@ -247,7 +249,8 @@ gimp_image_mask_select_vectors (GimpImage *gimage,
}
}
mask = gimp_scan_convert_to_channel (scan_convert, gimage);
if (num_coords)
mask = gimp_scan_convert_to_channel (scan_convert, gimage);
gimp_scan_convert_free (scan_convert);
......
......@@ -197,11 +197,12 @@ gimp_image_mask_select_vectors (GimpImage *gimage,
GList *stroke;
GArray *coords = NULL;
gboolean closed;
gint num_coords=0;
const gchar *undo_name = "Select Vectors"; /* this probably should be an
argument */
GimpScanConvert *scan_convert;
GimpChannel *mask;
GimpChannel *mask = NULL;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
......@@ -237,6 +238,7 @@ gimp_image_mask_select_vectors (GimpImage *gimage,
{
points[i].x = g_array_index (coords, GimpCoords, i).x;
points[i].y = g_array_index (coords, GimpCoords, i).y;
num_coords++;
}
gimp_scan_convert_add_points (scan_convert, coords->len,
......@@ -247,7 +249,8 @@ gimp_image_mask_select_vectors (GimpImage *gimage,
}
}
mask = gimp_scan_convert_to_channel (scan_convert, gimage);
if (num_coords)
mask = gimp_scan_convert_to_channel (scan_convert, gimage);
gimp_scan_convert_free (scan_convert);
......
......@@ -1304,6 +1304,12 @@ gimp_bezier_stroke_interpolate (const GimpStroke *stroke,
*ret_closed = stroke->closed;
if (ret_coords->len == 0)
{
g_array_free (ret_coords, TRUE);
ret_coords = NULL;
}
return ret_coords;
}
......@@ -1324,6 +1330,7 @@ gimp_bezier_stroke_get_anchor_listitem (GList *list)
return list->next;
g_return_val_if_fail (/* bezier stroke inconsistent! */ FALSE, NULL);
return NULL;
}
......
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