gimp r27589 - in trunk: . app/dialogs app/paint
- From: martinn svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r27589 - in trunk: . app/dialogs app/paint
- Date: Sun, 9 Nov 2008 20:12:37 +0000 (UTC)
Author: martinn
Date: Sun Nov 9 20:12:37 2008
New Revision: 27589
URL: http://svn.gnome.org/viewvc/gimp?rev=27589&view=rev
Log:
Bug 558549 â Stroking a single-point path with a paint tool
crashes GIMP
* app/paint/gimppaintcore-stroke.c
(gimp_paint_core_stroke_vectors): Return an error message if there
were not enough points to stroke.
* app/dialogs/stroke-dialog.c (stroke_dialog_response): Guard
against crashes if an implementator forgets to set an error.
Modified:
trunk/ChangeLog
trunk/app/dialogs/stroke-dialog.c
trunk/app/paint/gimppaintcore-stroke.c
Modified: trunk/app/dialogs/stroke-dialog.c
==============================================================================
--- trunk/app/dialogs/stroke-dialog.c (original)
+++ trunk/app/dialogs/stroke-dialog.c Sun Nov 9 20:12:37 2008
@@ -318,8 +318,11 @@
if (! gimp_item_stroke (item, drawable, context, options, FALSE, TRUE,
NULL, &error))
{
- gimp_message_literal (context->gimp, G_OBJECT (widget),
- GIMP_MESSAGE_WARNING, error->message);
+ gimp_message_literal (context->gimp,
+ G_OBJECT (widget),
+ GIMP_MESSAGE_WARNING,
+ error ? error->message : "NULL");
+
g_clear_error (&error);
return;
}
Modified: trunk/app/paint/gimppaintcore-stroke.c
==============================================================================
--- trunk/app/paint/gimppaintcore-stroke.c (original)
+++ trunk/app/paint/gimppaintcore-stroke.c Sun Nov 9 20:12:37 2008
@@ -33,6 +33,8 @@
#include "gimppaintcore-stroke.h"
#include "gimppaintoptions.h"
+#include "gimp-intl.h"
+
static void gimp_paint_core_stroke_emulate_dynamics (GimpCoords *coords,
gint length);
@@ -236,6 +238,7 @@
{
GList *stroke;
gboolean initialized = FALSE;
+ gboolean due_to_lack_of_points = FALSE;
gint off_x, off_y;
gint vectors_off_x, vectors_off_y;
@@ -309,6 +312,10 @@
break;
}
}
+ else
+ {
+ due_to_lack_of_points = TRUE;
+ }
if (coords)
g_array_free (coords, TRUE);
@@ -321,6 +328,13 @@
gimp_paint_core_cleanup (core);
}
+ if (! initialized &&
+ due_to_lack_of_points &&
+ *error == NULL)
+ {
+ g_set_error (error, 0, 0, _("Not enough points to stroke"));
+ }
+
return initialized;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]