gst/gststructure.c: Always check UTF-8 conformance of structure strings and not only if the debugging system is enabl...

Original commit message from CVS:
* gst/gststructure.c: (gst_structure_id_set_value):
Always check UTF-8 conformance of structure strings and not only
if the debugging system is enabled; reasoning: the behaviour of
the actual code shouldn't really change depending on whether the
debugging system is enabled or not (#508291).
This commit is contained in:
Tim-Philipp Müller 2008-01-09 15:05:21 +00:00
parent da77e2bae3
commit 73808617cf
2 changed files with 9 additions and 5 deletions

View file

@ -1,3 +1,11 @@
2008-01-09 Tim-Philipp Müller <tim at centricular dot net>
* gst/gststructure.c: (gst_structure_id_set_value):
Always check UTF-8 conformance of structure strings and not only
if the debugging system is enabled; reasoning: the behaviour of
the actual code shouldn't really change depending on whether the
debugging system is enabled or not (#508291).
2008-01-09 Stefan Kost <ensonic@users.sf.net>
* Makefile.am:

View file

@ -429,20 +429,16 @@ 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)) {
if (G_UNLIKELY (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));
return;
}
}
#endif
gsfield.name = field;
gst_value_init_and_copy (&gsfield.value, value);