--- old-startup/metadata/rb-metadata-gst.c	2006-03-17 21:17:19.000000000 +1000
+++ new-startup/metadata/rb-metadata-gst.c	2006-03-17 21:17:19.000000000 +1000
@@ -483,9 +483,19 @@ rb_metadata_gst_load_tag (const GstTagLi
 
 	switch (type) {
 	case G_TYPE_STRING: {
-		/* Remove leading and trailing whitespace */
+		/* Reject invalid utf-8 strings, and then
+		 * remove leading and trailing whitespace.
+		 */ 
 		char *str;
 		str = g_value_dup_string (newval);
+
+		if (!g_utf8_validate (str, -1, NULL)) {
+			rb_debug ("Got invalid UTF-8 tag data");
+			g_free (str);
+			g_value_unset (newval);
+			g_free (newval);
+			return;
+		}
 		str = g_strstrip (str);
 		g_value_take_string (newval, str);
 		break;

--- old-startup/daapsharing/rb-daap-connection.c	2006-03-17 21:17:19.000000000 +1000
+++ new-startup/daapsharing/rb-daap-connection.c	2006-03-17 21:17:19.000000000 +1000
@@ -1027,7 +1027,7 @@ entry_set_string_prop (RhythmDB *db, 
 	GValue value = {0,};
 	gchar *tmp;
 
-	if (str == NULL || *str == '\0') {
+	if (str == NULL || *str == '\0' || !g_utf8_validate (str, -1, NULL)) {
 		tmp = g_strdup (_("Unknown"));
 	} else {
 		tmp = g_strdup (str);

