forked from AuroraMiddleware/gtk
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.
This commit is contained in:
parent
5f5d3a9d82
commit
d6e9997619
@ -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 \
|
||||
|
3
testsuite/css/parser/animation-crash-3.12.css
Normal file
3
testsuite/css/parser/animation-crash-3.12.css
Normal file
@ -0,0 +1,3 @@
|
||||
* {
|
||||
animation: 2gra;
|
||||
}
|
1
testsuite/css/parser/animation-crash-3.12.errors
Normal file
1
testsuite/css/parser/animation-crash-3.12.errors
Normal file
@ -0,0 +1 @@
|
||||
animation-crash-3.12.css:2: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
|
0
testsuite/css/parser/animation-crash-3.12.ref.css
Normal file
0
testsuite/css/parser/animation-crash-3.12.ref.css
Normal file
Loading…
Reference in New Issue
Block a user