From b2f5af9a8285c3c960bc1e8618e1c0f349a63cb1 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 4 Jan 2008 21:05:57 +0000 Subject: gnome-mplayer: Fix segfaults decoding non-utf8 tags in media. --- .../files/non-utf8-id3-fallback.patch | 22 ++++++++++++++++++++++ .../gnome-mplayer/files/uchar-for-utf8-check.patch | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 packages/gnome-mplayer/files/non-utf8-id3-fallback.patch create mode 100644 packages/gnome-mplayer/files/uchar-for-utf8-check.patch (limited to 'packages/gnome-mplayer/files') diff --git a/packages/gnome-mplayer/files/non-utf8-id3-fallback.patch b/packages/gnome-mplayer/files/non-utf8-id3-fallback.patch new file mode 100644 index 0000000000..3b13bf0015 --- /dev/null +++ b/packages/gnome-mplayer/files/non-utf8-id3-fallback.patch @@ -0,0 +1,22 @@ +I found that on ARM/glibc 2.5/glib 2.12.something test in strip_unicode() doesn't +really catch invalid utf-8 chars. Also, let's tell user where problem lies straight. + +Paul Sokolovsky +--- a/src/thread.c.org 2007-12-24 00:10:15.000000000 +0200 ++++ a/src/thread.c 2008-01-04 22:04:30.000000000 +0200 +@@ -349,13 +349,11 @@ + //g_idle_add(set_media_info, idledata); + utf8name = g_locale_to_utf8(parse[name],-1, NULL, NULL,NULL); + if (utf8name == NULL) { +- strip_unicode(parse[name],strlen(parse[name])); +- utf8name = g_strdup(parse[name]); ++ utf8name = g_strdup(""); + } + utf8artist = g_locale_to_utf8(parse[artist],-1, NULL, NULL,NULL); + if (utf8artist == NULL) { +- strip_unicode(parse[artist],strlen(parse[artist])); +- utf8artist = g_strdup(parse[artist]); ++ utf8artist = g_strdup(""); + } + + message = g_markup_printf_escaped(_("\nTitle:\t%s\nArtist:\t%s\nFile:\t%s\n"),utf8name,utf8artist,idledata->info); diff --git a/packages/gnome-mplayer/files/uchar-for-utf8-check.patch b/packages/gnome-mplayer/files/uchar-for-utf8-check.patch new file mode 100644 index 0000000000..f19d20716e --- /dev/null +++ b/packages/gnome-mplayer/files/uchar-for-utf8-check.patch @@ -0,0 +1,22 @@ +--- a/src/support.c.org 2007-12-18 20:39:09.000000000 +0200 ++++ a/src/support.c 2008-01-04 22:12:32.000000000 +0200 +@@ -24,7 +24,7 @@ + + #include "support.h" + +-void strip_unicode(gchar * data, gsize len) ++void strip_unicode(guchar * data, gsize len) + { + gsize i = 0; + +--- a/src/support.h.org 2007-12-17 18:21:46.000000000 +0200 ++++ a/src/support.h 2008-01-04 22:24:15.000000000 +0200 +@@ -31,7 +31,7 @@ + #include + #include + +-void strip_unicode(gchar * data, gsize len); ++void strip_unicode(guchar * data, gsize len); + gint play_file(gchar * filename, gint playlist); + gint detect_playlist(gchar * filename); + gint parse_playlist(gchar * filename); -- cgit v1.2.3