From 246a3667eb7d204ce2df52bb1200435fab101e77 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 7 Jan 2004 03:06:19 +0000 Subject: [PATCH] ext/mad/gstid3tag.c: Add guard against invalid utf-8 conversions in mad. Just in case. Original commit message from CVS: 2004-01-07 Benjamin Otte * ext/mad/gstid3tag.c: (gst_mad_id3_to_tag_list): Add guard against invalid utf-8 conversions in mad. Just in case. --- ChangeLog | 5 +++++ ext/mad/gstid3tag.c | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 01c28e0..5fecd16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2004-01-07 Benjamin Otte + * ext/mad/gstid3tag.c: (gst_mad_id3_to_tag_list): + Add guard against invalid utf-8 conversions in mad. Just in case. + +2004-01-07 Benjamin Otte + * sys/oss/gstosssink.c: (gst_osssink_sink_fixate): Fix for bug shown by poisoning diff --git a/ext/mad/gstid3tag.c b/ext/mad/gstid3tag.c index 7f40c93..d656df6 100644 --- a/ext/mad/gstid3tag.c +++ b/ext/mad/gstid3tag.c @@ -468,6 +468,12 @@ gst_mad_id3_to_tag_list(const struct id3_tag *tag) utf8 = id3_ucs4_utf8duplicate(ucs4); if (utf8 == 0) continue; + + if (!g_utf8_validate (utf8, -1, NULL)) { + g_warning ("converted string is not valid utf-8"); + free (utf8); + continue; + } /* be sure to add non-string tags here */ switch (gst_tag_get_type (tag_name)) { -- 2.7.4