From b96f885fa130e3b6deab9793632bc5deecf5e94d Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 9 Nov 2003 21:26:13 +0000 Subject: [PATCH] Caps with empty props (which is not NULL - gst_props_new_empty()) can result in an invalid string, so we need to chec... Original commit message from CVS: Caps with empty props (which is not NULL - gst_props_new_empty()) can result in an invalid string, so we need to check for empty props (as opposed to NULL props) too. --- gst/gstcaps.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/gst/gstcaps.c b/gst/gstcaps.c index 7d7b456..69ea7a5 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -86,10 +86,13 @@ gst_caps_to_string (GstCaps *caps) g_value_set_boxed (&value, caps->properties); props = g_strdup_value_contents (&value); - g_value_unset (&value); - g_string_append (result, ", "); - g_string_append (result, props); - g_free (props); + /* this happens with empty (but existing) caps->properties */ + if (props[0] != '\0') { + g_value_unset (&value); + g_string_append (result, ", "); + g_string_append (result, props); + g_free (props); + } } caps = caps->next; -- 2.7.4