summaryrefslogtreecommitdiffstats
path: root/graphics/gpaint/patches/21_fix_crash_on_fill_button_click.patch
blob: 132b3490302a8be4cab452541ded7f1acd237a90 (plain)
Author: Goedson Teixeira Paixao <goedson@debian.org>
Description: fix crash on fill button click
 Avoid crashing when clicking on fill button by checking that
 tool->canvas->drawing_area is not null before casting it to GtkWidget
Bug-Debian: http://bugs.debian.org/544162
Bug-Ubuntu: https://bugs.edge.launchpad.net/ubuntu/+source/gpaint/+bug/227174
Bug: https://savannah.gnu.org/bugs/?25117
Forwarded: https://savannah.gnu.org/patch/?7045

Index: pkg-gpaint/src/text.c
===================================================================
--- pkg-gpaint.orig/src/text.c	2009-12-22 21:03:29.000000000 -0200
+++ pkg-gpaint/src/text.c	2009-12-23 13:01:33.000000000 -0200
@@ -156,7 +156,10 @@
 {
     debug_fn();
     GtkStyle *style;
-    GtkWidget *widget = GTK_WIDGET(tool->canvas->drawing_area);
+    GtkWidget *widget = NULL;
+
+    if ((tool->canvas == NULL) || (tool->canvas->drawing_area == NULL)) return FALSE;
+    widget = GTK_WIDGET(tool->canvas->drawing_area);
     style = gtk_widget_get_style(widget);
     g_assert(style);