From: <tp...@ke...> - 2006-03-21 16:34:59
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: tpm Date: Tue Mar 21 2006 14:24:53 UTC Log message: * 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). Modified files: . : ChangeLog gst : gststructure.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.2377&r2=1.2378 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gststructure.c.diff?r1=1.73&r2=1.74 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.2377 retrieving revision 1.2378 diff -u -d -r1.2377 -r1.2378 --- ChangeLog 21 Mar 2006 14:14:49 -0000 1.2377 +++ ChangeLog 21 Mar 2006 14:24:40 -0000 1.2378 @@ -1,6 +1,11 @@ -2006-03-21 Edward Hervey <ed...@fl...> +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 <ed...@fl...> * gst/gstbin.c: (gst_bin_dispose), (gst_bin_provide_clock_func), (gst_bin_handle_message_func): Index: gststructure.c RCS file: /cvs/gstreamer/gstreamer/gst/gststructure.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 --- gststructure.c 28 Feb 2006 10:52:02 -0000 1.73 +++ gststructure.c 21 Mar 2006 14:24:41 -0000 1.74 @@ -388,6 +388,20 @@ 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); |