diff options
author | Sebastian Rasmussen <sebras@hotmail.com> | 2014-04-06 11:23:34 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2014-04-06 14:24:21 +0100 |
commit | e1e5183181f17a4dd342a3b64210b109131f2ed6 (patch) | |
tree | b46ec30d4235ad319d57bd6d043e4d9036292fe1 /gst/gstdebugutils.c | |
parent | 6c2c49a590073afa1a1334e052496377054f3e54 (diff) |
debugutils: Handle caps field values being NULL
GST_DEBUG_BIN_TO_DOT_FILE() would cause a segfault whenever it encountered an
element's caps that had a field value being NULL. Such fields are successfully
handled e.g. by GST_*_OBJECT(), and with this patch so does
GST_DEBUG_BIN_TO_DOT_FILE(). Even if string fields with a NULL value are
not supposed to be valid in caps, such caps can be created.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727701
Diffstat (limited to 'gst/gstdebugutils.c')
-rw-r--r-- | gst/gstdebugutils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gst/gstdebugutils.c b/gst/gstdebugutils.c index 0beaf99b7..7b3ebf9c1 100644 --- a/gst/gstdebugutils.c +++ b/gst/gstdebugutils.c @@ -273,6 +273,11 @@ string_append_field (GQuark field, const GValue * value, gpointer ptr) gchar *value_str = gst_value_serialize (value); gchar *esc_value_str; + if (value_str == NULL) { + g_string_append_printf (str, " %18s: NULL\\l", g_quark_to_string (field)); + return TRUE; + } + /* some enums can become really long */ if (strlen (value_str) > 25) { gint pos = 24; |