Mercurial > hg > forks > geeqie
changeset 2233:083592055bcd
Fix crash when loading collection listing inexistent files.
author | Laurent Monin <zas@norz.org> |
---|---|
date | Mon, 26 Nov 2012 09:29:17 +0100 |
parents | 4617e1d83e9b |
children | 87ed572f1eea |
files | src/collect.c src/filedata.c |
diffstat | 2 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/collect.c Sun Oct 28 12:07:41 2012 +0100 +++ b/src/collect.c Mon Nov 26 09:29:17 2012 +0100 @@ -595,6 +595,10 @@ struct stat st; gboolean valid; + if (!fd) return FALSE; + + g_assert(fd->magick == FD_MAGICK); + if (must_exist) { valid = (stat_utf8(fd->path, &st) && !S_ISDIR(st.st_mode));
--- a/src/filedata.c Sun Oct 28 12:07:41 2012 +0100 +++ b/src/filedata.c Mon Nov 26 09:29:17 2012 +0100 @@ -1150,8 +1150,10 @@ filelist_read_real(dir, &files, NULL, TRUE); fd = g_hash_table_lookup(file_data_pool, path_utf8); - g_assert(fd); - file_data_ref(fd); + if (fd) + { + file_data_ref(fd); + } filelist_free(files); g_free(dir);