Commit d6e99976 authored by Benjamin Otte's avatar Benjamin Otte

css: Fail animation shorthand parsing properly

When a number is not a nubmer, don't just crash, exit properly with an
error code.

See attached testcase for an example.
parent 5f5d3a9d
......@@ -722,6 +722,9 @@ parse_one_animation (GtkCssShorthandProperty *shorthand,
GTK_CSS_POSITIVE_ONLY
| (values[1] == NULL ? GTK_CSS_PARSE_NUMBER : 0)
| (values[3] == NULL ? GTK_CSS_PARSE_TIME : 0));
if (value == NULL)
return FALSE;
if (_gtk_css_number_value_get_unit (value) == GTK_CSS_NUMBER)
values[1] = value;
else if (values[2] == NULL)
......
......@@ -30,6 +30,9 @@ clean-local:
rm $(builddir)/*.out.css || true
test_data = \
animation-crash-3.12.css \
animation-crash-3.12.errors \
animation-crash-3.12.ref.css \
animation-shorthand-crash.css \
animation-shorthand-crash.ref.css \
at-invalid-01.css \
......
animation-crash-3.12.css:2: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment