[easytag/f19] Avoid crash when clicking the window close button (#1071563)

David King amigadave at fedoraproject.org
Mon Mar 3 17:37:43 UTC 2014


commit 8323cb2216f09741a5c688badb22967efdac3928
Author: David King <amigadave at amigadave.com>
Date:   Mon Mar 3 17:05:50 2014 +0000

    Avoid crash when clicking the window close button (#1071563)

 easytag-2.1.10-avoid-close-button-crash.patch |   54 ++++++++++++++++++++++
 easytag-clarify-dlm-license.patch             |   61 -------------------------
 easytag.spec                                  |    7 +++-
 3 files changed, 60 insertions(+), 62 deletions(-)
---
diff --git a/easytag-2.1.10-avoid-close-button-crash.patch b/easytag-2.1.10-avoid-close-button-crash.patch
new file mode 100644
index 0000000..b949ea4
--- /dev/null
+++ b/easytag-2.1.10-avoid-close-button-crash.patch
@@ -0,0 +1,54 @@
+From 5442958d1ea34a992007bbb2bc047a9a5515387d Mon Sep 17 00:00:00 2001
+From: David King <amigadave at amigadave.com>
+Date: Mon, 3 Mar 2014 16:19:28 +0000
+Subject: [PATCH] Return a gboolean from delete-event handler
+
+Avoid undefined behaviour (manifesting as a crash on Fedora Rawhide) by
+correctly returning a gboolean in the main window delete-event handler.
+If the delete event was propagated by accident, the default handler
+would destroy the window and lead to many subsequent problems.
+
+Thanks to Igor Gnatenko for the bug report.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=725568
+https://bugzilla.redhat.com/show_bug.cgi?id=1071563
+---
+ src/easytag.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/src/easytag.c b/src/easytag.c
+index 29eeb82..7f6ecc7 100644
+--- a/src/easytag.c
++++ b/src/easytag.c
+@@ -156,6 +156,17 @@ static gboolean et_tag_field_on_key_press_event (GtkEntry *entry,
+                                                  GdkEventKey *event,
+                                                  gpointer user_data);
+ 
++static gboolean
++on_main_window_delete_event (GtkWidget *window,
++                             GdkEvent *event,
++                             gpointer user_data)
++{
++    Quit_MainWindow ();
++
++    /* Handled the event, so stop propagation. */
++    return TRUE;
++}
++
+ /*
+  * common_init:
+  * @application: the application
+@@ -225,8 +236,8 @@ common_init (GApplication *application)
+     // This part is needed to set correctly the position of handle panes
+     gtk_window_set_default_size(GTK_WINDOW(MainWindow),MAIN_WINDOW_WIDTH,MAIN_WINDOW_HEIGHT);
+ 
+-    g_signal_connect(G_OBJECT(MainWindow),"delete_event",G_CALLBACK(Quit_MainWindow),NULL);
+-    g_signal_connect(G_OBJECT(MainWindow),"destroy",G_CALLBACK(Quit_MainWindow),NULL);
++    g_signal_connect (MainWindow, "delete-event",
++                      G_CALLBACK (on_main_window_delete_event), NULL);
+ 
+     /* Minimised window icon */
+     gtk_widget_realize(MainWindow);
+-- 
+1.8.5.3
+
diff --git a/easytag.spec b/easytag.spec
index d602409..f8979c4 100644
--- a/easytag.spec
+++ b/easytag.spec
@@ -1,12 +1,13 @@
 Summary: Tag editor for MP3, Ogg, FLAC and other music files
 Name: easytag
 Version: 2.1.10
-Release: 1%{?dist}
+Release: 2%{?dist}
 # Program is GPL only the included libapetag is LGPL
 License: GPLv2+ and LGPLv2+
 Group: Applications/Multimedia
 URL: https://wiki.gnome.org/Apps/EasyTAG
 Source: http://download.gnome.org/sources/easytag/2.1/easytag-%{version}.tar.xz
+Patch0: easytag-2.1.10-avoid-close-button-crash.patch
 BuildRequires: appdata-tools
 BuildRequires: desktop-file-utils
 BuildRequires: docbook-dtds
@@ -30,6 +31,7 @@ MP2, FLAC, Ogg Vorbis, MusePack and Monkey's Audio files.
 
 %prep
 %setup -q
+%patch0 -p1
 
 
 %build
@@ -71,6 +73,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 
 
 %changelog
+* Mon Mar 03 2014 David King <amigadave at amigadave.com> 2.1.10-2
+- Avoid crash when clicking the window close button (#1071563)
+
 * Wed Feb 19 2014 David King <amigadave at amigadave.com> 2.1.10-1
 - Update to 2.1.10
 - Install AppData


More information about the scm-commits mailing list