mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-09 17:05:52 +00:00
Properly handle null string value, preventing core dump on Solaris.
Original commit message from CVS: Properly handle null string value, preventing core dump on Solaris.
This commit is contained in:
parent
13c11bbedf
commit
09c6aaa2f8
1 changed files with 8 additions and 2 deletions
|
@ -252,7 +252,7 @@ print_element_properties (GstElement *element)
|
||||||
GParamSpec **property_specs;
|
GParamSpec **property_specs;
|
||||||
gint num_properties,i;
|
gint num_properties,i;
|
||||||
gboolean readable;
|
gboolean readable;
|
||||||
|
const char *string_val;
|
||||||
|
|
||||||
property_specs = g_object_class_list_properties
|
property_specs = g_object_class_list_properties
|
||||||
(G_OBJECT_GET_CLASS (element), &num_properties);
|
(G_OBJECT_GET_CLASS (element), &num_properties);
|
||||||
|
@ -274,8 +274,14 @@ print_element_properties (GstElement *element)
|
||||||
|
|
||||||
switch (G_VALUE_TYPE (&value)) {
|
switch (G_VALUE_TYPE (&value)) {
|
||||||
case G_TYPE_STRING:
|
case G_TYPE_STRING:
|
||||||
|
string_val = g_value_get_string (&value);
|
||||||
g_print ("%-23.23s String. ", "");
|
g_print ("%-23.23s String. ", "");
|
||||||
if (readable) g_print ("(Default \"%s\")", g_value_get_string (&value));
|
if (readable) {
|
||||||
|
if (string_val == NULL)
|
||||||
|
g_print ("(Default \"\")");
|
||||||
|
else
|
||||||
|
g_print ("(Default \"%s\")", g_value_get_string (&value));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case G_TYPE_BOOLEAN:
|
case G_TYPE_BOOLEAN:
|
||||||
g_print ("%-23.23s Boolean. ", "");
|
g_print ("%-23.23s Boolean. ", "");
|
||||||
|
|
Loading…
Reference in a new issue