[gtk2] avoid a crash

Matthias Clasen mclasen at fedoraproject.org
Mon Sep 29 20:33:31 UTC 2014


commit 26124126d1fea08e9b55d5b1d1e1d51988aebad8
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Mon Sep 29 16:21:29 2014 -0400

    avoid a crash

 ...uf-engine-Avoid-a-crash-if-widget-is-NULL.patch |   31 ++++++++++++++++++++
 gtk2.spec                                          |    8 ++++-
 2 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/0001-pixbuf-engine-Avoid-a-crash-if-widget-is-NULL.patch b/0001-pixbuf-engine-Avoid-a-crash-if-widget-is-NULL.patch
new file mode 100644
index 0000000..0430798
--- /dev/null
+++ b/0001-pixbuf-engine-Avoid-a-crash-if-widget-is-NULL.patch
@@ -0,0 +1,31 @@
+From 1d0e2d58385bd01fdb753bf40ba2f4c32ccd0cc8 Mon Sep 17 00:00:00 2001
+From: Matthias Clasen <mclasen at redhat.com>
+Date: Mon, 29 Sep 2014 16:05:57 -0400
+Subject: [PATCH] pixbuf engine: Avoid a crash if widget is NULL
+
+Commit 85f2a721cf introduced an unconditional call to
+gtk_widget_get_direction(). This does not work for 'foreign'
+uses of the theme engine, e.g. in Qt, where widget is NULL.
+
+This was reported as a crash in Fedora here:
+https://bugzilla.redhat.com/show_bug.cgi?id=924683
+---
+ modules/engines/pixbuf/pixbuf-draw.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/engines/pixbuf/pixbuf-draw.c b/modules/engines/pixbuf/pixbuf-draw.c
+index 9239bd1..5448d81 100644
+--- a/modules/engines/pixbuf/pixbuf-draw.c
++++ b/modules/engines/pixbuf/pixbuf-draw.c
+@@ -131,7 +131,7 @@ draw_simple_image(GtkStyle       *style,
+ 	match_data->orientation = GTK_ORIENTATION_HORIZONTAL;
+     }
+ 
+-  if (!(match_data->flags & THEME_MATCH_DIRECTION))
++  if (widget && !(match_data->flags & THEME_MATCH_DIRECTION))
+     {
+       match_data->flags |= THEME_MATCH_DIRECTION;
+       match_data->direction = gtk_widget_get_direction (widget);
+-- 
+2.1.0
+
diff --git a/gtk2.spec b/gtk2.spec
index 40f8abf..f47bd0b 100644
--- a/gtk2.spec
+++ b/gtk2.spec
@@ -18,7 +18,7 @@
 Summary: The GIMP ToolKit (GTK+), a library for creating GUIs for X
 Name: gtk2
 Version: 2.24.24
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: LGPLv2+
 Group: System Environment/Libraries
 URL: http://www.gtk.org
@@ -36,6 +36,8 @@ Patch8: tooltip-positioning.patch
 # https://bugzilla.gnome.org/show_bug.cgi?id=611313
 Patch15: window-dragging.patch
 Patch16: 0001-threads-Do-not-release-the-GDK-lock-if-it-hasn-t-bee.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=924683
+Patch17: 0001-pixbuf-engine-Avoid-a-crash-if-widget-is-NULL.patch
 
 BuildRequires: atk-devel >= %{atk_version}
 BuildRequires: glib2-devel >= %{glib2_version}
@@ -148,6 +150,7 @@ This package contains developer documentation for the GTK+ widget toolkit.
 %patch8 -p1 -b .tooltip-positioning
 %patch15 -p1 -b .window-dragging
 %patch16 -p1 -b .trylock
+%patch17 -p1 -b .qtcrash
 
 %build
 (if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; CONFIGFLAGS=--enable-gtk-doc; fi;
@@ -337,6 +340,9 @@ gtk-query-immodules-2.0-%{__isa_bits} --update-cache
 %doc tmpdocs/examples
 
 %changelog
+* Mon Sep 29 2014 Matthias Clasen <mclasen at redhat.com> - 2.24.24-4
+- Avoid a crash in the pixbuf engine when used from Qt
+
 * Thu Sep 04 2014 Kalev Lember <kalevlember at gmail.com> - 2.24.24-3
 - Do not abort when releasing an unlocked mutex (#1138146)
 


More information about the scm-commits mailing list