-2006-03-21 Edward Hervey <edward@fluendo.com>
+2006-03-21 Tim-Philipp Müller <tim at centricular dot net>
- reviewed by: <delete if not using a buddy>
+ * 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 <edward@fluendo.com>
* gst/gstbin.c: (gst_bin_dispose), (gst_bin_provide_clock_func),
(gst_bin_handle_message_func):
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);