[rhythmbox] mtp: ignore non-utf8 strings we get from libmtp (bug #564772)



commit 4ed644acc178c0319cb2217dd26132e82b0eed97
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sun Oct 11 07:55:24 2009 +1000

    mtp: ignore non-utf8 strings we get from libmtp (bug #564772)

 plugins/mtpdevice/rb-mtp-source.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/plugins/mtpdevice/rb-mtp-source.c b/plugins/mtpdevice/rb-mtp-source.c
index a51fbe5..c5d8c8c 100644
--- a/plugins/mtpdevice/rb-mtp-source.c
+++ b/plugins/mtpdevice/rb-mtp-source.c
@@ -442,8 +442,9 @@ entry_set_string_prop (RhythmDB *db,
 {
 	GValue value = {0,};
 
-	if (!str)
+	if (str == NULL || (g_utf8_validate (str, -1, NULL) == FALSE)) {
 		str = _("Unknown");
+	}
 
 	g_value_init (&value, G_TYPE_STRING);
 	g_value_set_static_string (&value, str);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]