mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
fix stupid segfault when setting integer properties
Original commit message from CVS: fix stupid segfault when setting integer properties
This commit is contained in:
parent
e277d26a68
commit
d02583b999
1 changed files with 3 additions and 3 deletions
|
@ -267,7 +267,7 @@ gst_parse_element_set (gchar *value, GstElement *element, graph_t *graph)
|
||||||
break;
|
break;
|
||||||
case G_TYPE_ENUM: {
|
case G_TYPE_ENUM: {
|
||||||
GEnumValue *en;
|
GEnumValue *en;
|
||||||
gchar **endptr = NULL;
|
gchar *endptr = NULL;
|
||||||
GEnumClass *klass = (GEnumClass *) g_type_class_peek (G_PARAM_SPEC_VALUE_TYPE (pspec));
|
GEnumClass *klass = (GEnumClass *) g_type_class_peek (G_PARAM_SPEC_VALUE_TYPE (pspec));
|
||||||
if (klass == NULL) goto error;
|
if (klass == NULL) goto error;
|
||||||
if (!(en = g_enum_get_value_by_name (klass, pos)))
|
if (!(en = g_enum_get_value_by_name (klass, pos)))
|
||||||
|
@ -275,8 +275,8 @@ gst_parse_element_set (gchar *value, GstElement *element, graph_t *graph)
|
||||||
if (en) {
|
if (en) {
|
||||||
g_value_set_enum (&v, en->value);
|
g_value_set_enum (&v, en->value);
|
||||||
} else {
|
} else {
|
||||||
gint i = strtol (value, endptr, 0);
|
gint i = strtol (value, &endptr, 0);
|
||||||
if (**endptr == '\0') {
|
if (*endptr == '\0') {
|
||||||
g_value_set_enum (&v, i);
|
g_value_set_enum (&v, i);
|
||||||
} else {
|
} else {
|
||||||
goto error;
|
goto error;
|
||||||
|
|
Loading…
Reference in a new issue