From 73808617cfdb7b18a6234ff985a1595dea629639 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 9 Jan 2008 15:05:21 +0000 Subject: [PATCH] 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). --- ChangeLog | 8 ++++++++ gst/gststructure.c | 6 +----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 46ba485..8f186d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-01-09 Tim-Philipp Müller + + * 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 * Makefile.am: diff --git a/gst/gststructure.c b/gst/gststructure.c index 537bb4a..89f61cc 100644 --- a/gst/gststructure.c +++ b/gst/gststructure.c @@ -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); -- 2.7.4