summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorteuf <teuf@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2007-11-14 18:23:29 +0000
committerteuf <teuf@f01d2545-417e-4e96-918e-98f8d0dbbcb6>2007-11-14 18:23:29 +0000
commit7429a86c260092c9fec5131d4e190062bfd02893 (patch)
tree71b0baa12408076944b02a1577f82e068d01c383
parenteaa15870ec1078f7ffda00ab01133e4bfe2a8c19 (diff)
downloadlibgpod-7429a86c260092c9fec5131d4e190062bfd02893.tar.gz
libgpod-7429a86c260092c9fec5131d4e190062bfd02893.tar.xz
libgpod-7429a86c260092c9fec5131d4e190062bfd02893.zip
* src/itdb_itunesdb.c: ignore invalid UTF-8 paths which might have
been added to the iPod by the user git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1786 f01d2545-417e-4e96-918e-98f8d0dbbcb6
-rw-r--r--ChangeLog5
-rw-r--r--src/itdb_itunesdb.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 30bca1b..1e5e998 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2007-11-14 Christophe <teuf@gnome.org>
+ * src/itdb_itunesdb.c: ignore invalid UTF-8 paths which might have
+ been added to the iPod by the user
+
+2007-11-14 Christophe <teuf@gnome.org>
+
* src/itdb_photoalbum.c: use g_list_remove all instead of an
inefficient combination of g_list_find + g_list_remove
diff --git a/src/itdb_itunesdb.c b/src/itdb_itunesdb.c
index cf9374e..1e78fef 100644
--- a/src/itdb_itunesdb.c
+++ b/src/itdb_itunesdb.c
@@ -385,10 +385,17 @@ gchar * itdb_resolve_path (const gchar *root,
cur_dir = g_dir_open(good_path,0,NULL);
if (cur_dir) while ((dir_file = g_dir_read_name(cur_dir)))
{
- gchar *file_utf8 = g_filename_to_utf8(dir_file,-1,NULL,NULL,NULL);
- gchar *file_stdcase = g_utf8_casefold(file_utf8,-1);
- gboolean found = !g_utf8_collate(file_stdcase,component_stdcase);
+ gchar *file_utf8;
+ gchar *file_stdcase;
+ gboolean found;
gchar *new_good_path;
+
+ file_utf8 = g_filename_to_utf8(dir_file,-1,NULL,NULL,NULL);
+ if (file_utf8 == NULL) {
+ continue;
+ }
+ file_stdcase = g_utf8_casefold(file_utf8,-1);
+ found = !g_utf8_collate(file_stdcase,component_stdcase);
g_free(file_stdcase);
if(!found)
{