[xchat-gnome] Fix crasher, clean up noise.
Bill Nottingham
notting at fedoraproject.org
Fri Jun 17 20:08:22 UTC 2011
commit 5258a6f73a91e93f5db1d507d33427e9cd349228
Author: Bill Nottingham <notting at redhat.com>
Date: Fri Jun 17 16:07:13 2011 -0400
Fix crasher, clean up noise.
...nt-attempt-to-render-a-nonexistent-string.patch | 26 ++++++++++++
0002-Plugin_GetCurrent-can-return-NULL.patch | 41 ++++++++++++++++++++
...-pixmap-depth-matches-screen-window-depth.patch | 26 ++++++++++++
xchat-gnome.spec | 16 +++++++-
4 files changed, 107 insertions(+), 2 deletions(-)
---
diff --git a/0001-Dont-attempt-to-render-a-nonexistent-string.patch b/0001-Dont-attempt-to-render-a-nonexistent-string.patch
new file mode 100644
index 0000000..fc22dd9
--- /dev/null
+++ b/0001-Dont-attempt-to-render-a-nonexistent-string.patch
@@ -0,0 +1,26 @@
+From 658b8d21e2ad4d158db6e189cc622e6a8e6b756b Mon Sep 17 00:00:00 2001
+From: Bill Nottingham <notting at redhat.com>
+Date: Wed, 13 Apr 2011 22:40:17 -0400
+Subject: [PATCH 1/3] Dont' attempt to render a nonexistent string.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=652867
+---
+ src/fe-gnome/xtext.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/fe-gnome/xtext.c b/src/fe-gnome/xtext.c
+index 06b00c5..6cba1d5 100644
+--- a/src/fe-gnome/xtext.c
++++ b/src/fe-gnome/xtext.c
+@@ -2645,7 +2645,7 @@ gtk_xtext_render_flush (GtkXText * xtext, int x, int y, unsigned char *str,
+
+ str_width = backend_get_text_width (xtext, str, len, is_mb);
+
+- if (xtext->dont_render2)
++ if (xtext->dont_render2 || str_width < 1)
+ return str_width;
+
+ /* roll-your-own clipping (avoiding XftDrawString is always good!) */
+--
+1.7.5.2
+
diff --git a/0002-Plugin_GetCurrent-can-return-NULL.patch b/0002-Plugin_GetCurrent-can-return-NULL.patch
new file mode 100644
index 0000000..35a4fca
--- /dev/null
+++ b/0002-Plugin_GetCurrent-can-return-NULL.patch
@@ -0,0 +1,41 @@
+From 7604517bd9c400ae60ab64b82aea1b9665e4122c Mon Sep 17 00:00:00 2001
+From: Bill Nottingham <notting at redhat.com>
+Date: Tue, 19 Apr 2011 17:09:44 -0400
+Subject: [PATCH 2/3] Plugin_GetCurrent() can return NULL.
+
+Check its return before dereferencing it.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=652866
+---
+ plugins/python/python.c | 7 ++++++-
+ 1 files changed, 6 insertions(+), 1 deletions(-)
+
+diff --git a/plugins/python/python.c b/plugins/python/python.c
+index 53267a3..bcceed1 100644
+--- a/plugins/python/python.c
++++ b/plugins/python/python.c
+@@ -791,6 +791,8 @@ static PyObject *
+ Context_set(ContextObject *self, PyObject *args)
+ {
+ PyObject *plugin = Plugin_GetCurrent();
++ if (plugin == NULL)
++ return NULL;
+ Plugin_SetContext(plugin, self->context);
+ Py_INCREF(Py_None);
+ return Py_None;
+@@ -867,8 +869,11 @@ static PyObject *
+ Context_get_list(ContextObject *self, PyObject *args)
+ {
+ PyObject *plugin = Plugin_GetCurrent();
+- xchat_context *saved_context = Plugin_GetContext(plugin);
++ xchat_context *saved_context;
+ PyObject *ret;
++ if (plugin == NULL)
++ return NULL;
++ saved_context = Plugin_GetContext(plugin);
+ Plugin_SetContext(plugin, self->context);
+ ret = Module_xchat_get_list((PyObject*)self, args);
+ Plugin_SetContext(plugin, saved_context);
+--
+1.7.5.2
+
diff --git a/0003-Ensure-pixmap-depth-matches-screen-window-depth.patch b/0003-Ensure-pixmap-depth-matches-screen-window-depth.patch
new file mode 100644
index 0000000..3be4915
--- /dev/null
+++ b/0003-Ensure-pixmap-depth-matches-screen-window-depth.patch
@@ -0,0 +1,26 @@
+From 9464eeb4bd0b3f09901d18357dee06d084989162 Mon Sep 17 00:00:00 2001
+From: Bill Nottingham <notting at redhat.com>
+Date: Fri, 17 Jun 2011 15:49:09 -0400
+Subject: [PATCH 3/3] Ensure pixmap depth matches screen/window depth.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=652865
+---
+ src/fe-gnome/conversation-panel.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/fe-gnome/conversation-panel.c b/src/fe-gnome/conversation-panel.c
+index 59e1bcd..b230fd5 100644
+--- a/src/fe-gnome/conversation-panel.c
++++ b/src/fe-gnome/conversation-panel.c
+@@ -592,7 +592,7 @@ conversation_panel_set_background (ConversationPanel *panel)
+ width = gdk_pixbuf_get_width (pixbuf);
+ height = gdk_pixbuf_get_height (pixbuf);
+
+- image = gdk_pixmap_new (NULL, width, height, 24);
++ image = gdk_pixmap_new (GDK_DRAWABLE (panel->priv->xtext->window), width, height, -1);
+ #if GTK_CHECK_VERSION (2, 23, 0)
+ context = gdk_cairo_create (GDK_DRAWABLE (image));
+ gdk_cairo_set_source_pixbuf (context, pixbuf, 0, 0);
+--
+1.7.5.2
+
diff --git a/xchat-gnome.spec b/xchat-gnome.spec
index ff25277..23af58c 100644
--- a/xchat-gnome.spec
+++ b/xchat-gnome.spec
@@ -2,7 +2,7 @@
Name: xchat-gnome
Version: 0.26.2
-Release: 0.git%{gitrev}%{?dist}
+Release: 1.git%{gitrev}%{?dist}
Summary: GNOME front-end to xchat
Group: Applications/Internet
@@ -22,6 +22,12 @@ Patch1: xchat-gnome-0.26.1-libnotify.patch
Patch10: xchat-gnome-0.26.1-recent-network-manager.patch
# Convert deprecated GDK functions to cairo
Patch13: xchat-gnome-0.26.1-remove-deprecated-api.patch
+# Clean up warnings
+Patch100: 0001-Dont-attempt-to-render-a-nonexistent-string.patch
+# Fix potential plugin crashers
+Patch101: 0002-Plugin_GetCurrent-can-return-NULL.patch
+# Don't crash on 32bpp depth
+Patch102: 0003-Ensure-pixmap-depth-matches-screen-window-depth.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -68,7 +74,9 @@ common settings will be included in the main user interface. .
%patch1 -p1 -b .notify
%patch10 -p1 -b .recent-nm
%patch13 -p1 -b .gdk-deprecations
-
+%patch100 -p1 -b .empty
+%patch101 -p1 -b .nullplugin
+%patch102 -p1 -b .depth
%build
./autogen.sh
@@ -135,6 +143,10 @@ fi
%changelog
+* Fri Jun 17 2011 Bill Nottingham <notting at redhat.com> - 0.26.2-1
+- fix crash on 32bpp depths with background images (#712626)
+- clean up some Gdk-CRITICAL messages
+
* Thu Apr 07 2011 Bill Nottingham <notting at redhat.com> - 0.26.2-1
- update to 0.26.2 (fixes #660840)
More information about the scm-commits
mailing list