fix stupid segfault when setting integer properties

Original commit message from CVS:
fix stupid segfault when setting integer properties
This commit is contained in:
Benjamin Otte 2003-04-24 22:34:10 +00:00
parent e277d26a68
commit d02583b999

View file

@ -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;