mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-22 12:32:37 +00:00
app/vectors/gimpstroke.c app/vectors/gimpvectors-preview.c
2003-08-22 Simon Budig <simon@gimp.org> * app/vectors/gimpstroke.c * app/vectors/gimpvectors-preview.c * app/tools/gimptransformtool.c * app/tools/gimpvectortool.c: Added missing checking for NULL return values. Hopefully this fixes the crashes others are observing.
This commit is contained in:
parent
9d31a9db10
commit
d368e27e5a
|
@ -1,3 +1,12 @@
|
|||
2003-08-22 Simon Budig <simon@gimp.org>
|
||||
|
||||
* app/vectors/gimpstroke.c
|
||||
* app/vectors/gimpvectors-preview.c
|
||||
* app/tools/gimptransformtool.c
|
||||
* app/tools/gimpvectortool.c: Added missing checking for NULL
|
||||
return values. Hopefully this fixes the crashes others are
|
||||
observing.
|
||||
|
||||
2003-08-22 Simon Budig <simon@gimp.org>
|
||||
|
||||
* app/vectors/gimpbezierstroke.c: fixed crash when deleting
|
||||
|
|
|
@ -764,6 +764,8 @@ gimp_transform_tool_draw (GimpDrawTool *draw_tool)
|
|||
|
||||
coords = gimp_stroke_interpolate (stroke, 1.0, &closed);
|
||||
|
||||
if (coords)
|
||||
{
|
||||
for (i = 0; i < coords->len; i++)
|
||||
{
|
||||
GimpCoords *curr = &g_array_index (coords, GimpCoords, i);
|
||||
|
@ -783,6 +785,7 @@ gimp_transform_tool_draw (GimpDrawTool *draw_tool)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static TileManager *
|
||||
|
|
|
@ -982,6 +982,8 @@ gimp_vector_tool_draw (GimpDrawTool *draw_tool)
|
|||
/* the lines to the control handles */
|
||||
coords = gimp_stroke_get_draw_lines (cur_stroke);
|
||||
|
||||
if (coords)
|
||||
{
|
||||
if (coords->len % 2 == 0)
|
||||
{
|
||||
gint i;
|
||||
|
@ -994,6 +996,7 @@ gimp_vector_tool_draw (GimpDrawTool *draw_tool)
|
|||
}
|
||||
|
||||
g_array_free (coords, TRUE);
|
||||
}
|
||||
|
||||
/* the stroke itself */
|
||||
coords = gimp_stroke_interpolate (cur_stroke, 1.0, &closed);
|
||||
|
|
|
@ -1000,7 +1000,8 @@ static GArray *
|
|||
gimp_stroke_real_get_draw_lines (const GimpStroke *stroke)
|
||||
{
|
||||
GList *list;
|
||||
GArray *ret_lines = g_array_new (FALSE, FALSE, sizeof (GimpCoords));
|
||||
GArray *ret_lines = NULL;
|
||||
gint count = 0;
|
||||
|
||||
for (list = stroke->anchors; list; list = g_list_next (list))
|
||||
{
|
||||
|
@ -1012,16 +1013,24 @@ gimp_stroke_real_get_draw_lines (const GimpStroke *stroke)
|
|||
{
|
||||
GimpAnchor *next = list->next->data;
|
||||
|
||||
if (count == 0)
|
||||
ret_lines = g_array_new (FALSE, FALSE, sizeof (GimpCoords));
|
||||
|
||||
ret_lines = g_array_append_val (ret_lines, anchor->position);
|
||||
ret_lines = g_array_append_val (ret_lines, next->position);
|
||||
count += 1;
|
||||
}
|
||||
|
||||
if (list->prev)
|
||||
{
|
||||
GimpAnchor *prev = list->prev->data;
|
||||
|
||||
if (count == 0)
|
||||
ret_lines = g_array_new (FALSE, FALSE, sizeof (GimpCoords));
|
||||
|
||||
ret_lines = g_array_append_val (ret_lines, anchor->position);
|
||||
ret_lines = g_array_append_val (ret_lines, prev->position);
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,6 +67,8 @@ gimp_vectors_get_new_preview (GimpViewable *viewable,
|
|||
|
||||
coords = gimp_stroke_interpolate (cur_stroke, 0.5, &closed);
|
||||
|
||||
if (coords)
|
||||
{
|
||||
for (i = 0; i < coords->len; i++)
|
||||
{
|
||||
GimpCoords point;
|
||||
|
@ -83,6 +85,7 @@ gimp_vectors_get_new_preview (GimpViewable *viewable,
|
|||
|
||||
g_array_free (coords, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
return temp_buf;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue