diff --git a/ChangeLog b/ChangeLog index 4175dfd11c..9aaf26ee15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ -2006-03-21 Edward Hervey +2006-03-21 Tim-Philipp Müller - reviewed by: + * gst/gststructure.c: (gst_structure_id_set_value): + Make sure that string fields in structures/taglists + contain valid UTF-8 - we don't want to pass rubbish to + applications because of a buggy plugin (cp. #334167). + +2006-03-21 Edward Hervey * gst/gstbin.c: (gst_bin_dispose), (gst_bin_provide_clock_func), (gst_bin_handle_message_func): diff --git a/gst/gststructure.c b/gst/gststructure.c index 0d3cbc2701..04a6a99c8f 100644 --- a/gst/gststructure.c +++ b/gst/gststructure.c @@ -388,6 +388,20 @@ gst_structure_id_set_value (GstStructure * structure, g_return_if_fail (G_IS_VALUE (value)); g_return_if_fail (IS_MUTABLE (structure)); + /* if someones disables GST_DEBUG output, they probably do it for + * performance reasons, so skip the UTF-8 check here as well then */ +#ifndef GST_DISABLE_GST_DEBUG + if (G_VALUE_HOLDS_STRING (value)) { + const gchar *s; + + s = g_value_get_string (value); + if (s != NULL && !g_utf8_validate (s, -1, NULL)) { + g_warning ("Trying to set string field '%s' on structure, but string is " + "not valid UTF-8. Please file a bug.", g_quark_to_string (field)); + } + } +#endif + gsfield.name = field; gst_value_init_and_copy (&gsfield.value, value);