From 4af069ff33b70084aa2670fa0a2b47dcff8efea6 Mon Sep 17 00:00:00 2001 From: Michael Schwendt Date: May 27 2014 08:05:07 +0000 Subject: Merge fix for avoiding crash due to inexistent files in collections. This also replaces the history path_list patch. --- diff --git a/geeqie-1.1-collection-and-history-inexistent-files.patch b/geeqie-1.1-collection-and-history-inexistent-files.patch new file mode 100644 index 0000000..7c6b9fa --- /dev/null +++ b/geeqie-1.1-collection-and-history-inexistent-files.patch @@ -0,0 +1,31 @@ +Originally from Laurent Monin in Geeqie gitorious merge request 5. + +diff -Nurb --strip-trailing-cr geeqie-1.1-orig/src/collect.c geeqie-1.1/src/collect.c +--- geeqie-1.1-orig/src/collect.c 2012-08-12 22:13:41.000000000 +0200 ++++ geeqie-1.1/src/collect.c 2014-05-27 09:47:48.549380177 +0200 +@@ -635,6 +635,10 @@ + struct stat st; + gboolean valid; + ++ if (!fd) return FALSE; ++ ++ g_assert(fd->magick == 0x12345678); ++ + if (must_exist) + { + valid = (stat_utf8(fd->path, &st) && !S_ISDIR(st.st_mode)); +diff -Nurb --strip-trailing-cr geeqie-1.1-orig/src/filedata.c geeqie-1.1/src/filedata.c +--- geeqie-1.1-orig/src/filedata.c 2012-08-12 22:13:41.000000000 +0200 ++++ geeqie-1.1/src/filedata.c 2014-05-27 09:48:43.164458254 +0200 +@@ -1098,8 +1098,10 @@ + filelist_read_real(dir, &files, NULL, TRUE); + + fd = g_hash_table_lookup(file_data_pool, path_utf8); +- g_assert(fd); ++ if (fd) ++ { + file_data_ref(fd); ++ } + + filelist_free(files); + g_free(dir); diff --git a/geeqie-1.1-filedata-avoid-history-abort.patch b/geeqie-1.1-filedata-avoid-history-abort.patch deleted file mode 100644 index eb74177..0000000 --- a/geeqie-1.1-filedata-avoid-history-abort.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff -Nur geeqie-1.1-orig/src/filedata.c geeqie-1.1/src/filedata.c ---- geeqie-1.1-orig/src/filedata.c 2012-08-12 22:13:41.000000000 +0200 -+++ geeqie-1.1/src/filedata.c 2013-02-08 21:07:49.742677702 +0100 -@@ -1098,9 +1098,11 @@ - filelist_read_real(dir, &files, NULL, TRUE); - - fd = g_hash_table_lookup(file_data_pool, path_utf8); -+ if (!fd) /* non-existing paths from history path_list would abort/crash */ -+ goto RETURN_1; - g_assert(fd); - file_data_ref(fd); -- -+ RETURN_1: - filelist_free(files); - g_free(dir); - return fd; diff --git a/geeqie.spec b/geeqie.spec index f7f7b08..4d885ff 100644 --- a/geeqie.spec +++ b/geeqie.spec @@ -8,7 +8,7 @@ Summary: Image browser and viewer Name: geeqie Version: 1.1 -Release: 17%{?dist} +Release: 18%{?dist} License: GPLv2+ Group: User Interface/X Source: http://downloads.sf.net/sourceforge/geeqie/%{name}-%{upstreamversion}.tar.gz @@ -30,7 +30,9 @@ Patch4: geeqie-1.1-editors-NULL.patch Patch5: geeqie-1.1-filedata-change-notification.patch # reported upstream # https://sourceforge.net/tracker/?func=detail&aid=3603866&group_id=222125&atid=1054680 -Patch6: geeqie-1.1-filedata-avoid-history-abort.patch +# avoid crash due to non-existent files in history path_list and collections +# improved patch in gitorious merge request 5 +Patch6: geeqie-1.1-collection-and-history-inexistent-files.patch # reported upstream # https://sourceforge.net/tracker/?func=detail&aid=3605406&group_id=222125&atid=1054682 Patch7: geeqie-1.1-large-files.patch @@ -91,7 +93,7 @@ done %patch3 -p1 -b .fix-dialog-close %patch4 -p1 -b .editors-NULL %patch5 -p1 -b .filedata-notification -%patch6 -p1 -b .filedata-avoid-history-abort +%patch6 -p1 -b .collection-inexistent-files %patch7 -p1 -b .large-files %if ! %{with lcms1} %patch8 -p1 @@ -147,6 +149,10 @@ update-desktop-database &> /dev/null || : %changelog +* Tue May 27 2014 Michael Schwendt - 1.1-18 +- Merge fix for avoiding crash due to inexistent files in collections. + This also replaces the history path_list patch. + * Sun Jan 26 2014 Michael Schwendt - 1.1-17 - Merge image-overlay.c fix for handling of filenames with % in them.