diff --git a/gtk/gtkcssshorthandpropertyimpl.c b/gtk/gtkcssshorthandpropertyimpl.c index 0ada0f6a3e..290c6afdd0 100644 --- a/gtk/gtkcssshorthandpropertyimpl.c +++ b/gtk/gtkcssshorthandpropertyimpl.c @@ -387,7 +387,7 @@ parse_border (GtkCssShorthandProperty *shorthand, values[6] = _gtk_css_value_ref (values[4]); values[7] = _gtk_css_value_ref (values[4]); } - else if (!G_IS_VALUE (&values[8])) + else if (values[8] == NULL) { values[8] = _gtk_css_color_value_parse (parser); if (values[8] == NULL) diff --git a/testsuite/css/parser/border-crash-3.24.css b/testsuite/css/parser/border-crash-3.24.css new file mode 100644 index 0000000000..971048e2a8 --- /dev/null +++ b/testsuite/css/parser/border-crash-3.24.css @@ -0,0 +1,4 @@ +* { + border: 2px solid alpha(black, 0.3) + padding: 2px; +} diff --git a/testsuite/css/parser/border-crash-3.24.errors b/testsuite/css/parser/border-crash-3.24.errors new file mode 100644 index 0000000000..c49f1d071a --- /dev/null +++ b/testsuite/css/parser/border-crash-3.24.errors @@ -0,0 +1 @@ +border-crash-3.24.css:3: error: GTK_CSS_PROVIDER_ERROR_SYNTAX diff --git a/testsuite/css/parser/border-crash-3.24.ref.css b/testsuite/css/parser/border-crash-3.24.ref.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/testsuite/css/parser/meson.build b/testsuite/css/parser/meson.build index 573f0a7087..1e171aaa36 100644 --- a/testsuite/css/parser/meson.build +++ b/testsuite/css/parser/meson.build @@ -156,12 +156,15 @@ test_data = [ 'backslash-eof-is-identifier.css', 'backslash-eof-is-identifier.errors', 'backslash-eof-is-identifier.ref.css', + 'border.css', + 'border.errors', 'border-color.css', 'border-color-currentcolor.css', 'border-color-currentcolor.ref.css', 'border-color.ref.css', - 'border.css', - 'border.errors', + 'border-crash-3.24.css', + 'border-crash-3.24.errors', + 'border-crash-3.24.ref.css', 'border-image-repeat.css', 'border-image-repeat.ref.css', 'border-image-slice.css',