mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-24 20:51:10 +00:00
css: Don't crash when color stop offsets descend
Testcase included. Fixes #4424
This commit is contained in:
parent
fcb3638ac3
commit
46f8600b6a
@ -178,7 +178,7 @@ gtk_css_image_radial_snapshot (GtkCssImage *image,
|
||||
else
|
||||
pos = MIN (1.0, _gtk_css_number_value_get (stop->offset, hradius) / hradius);
|
||||
|
||||
pos = MAX (pos, 0);
|
||||
pos = MAX (pos, offset);
|
||||
step = (pos - offset) / (i - last);
|
||||
for (last = last + 1; last <= i; last++)
|
||||
{
|
||||
|
@ -0,0 +1,7 @@
|
||||
window {
|
||||
background: red;
|
||||
}
|
||||
|
||||
#test {
|
||||
background: radial-gradient(circle, red 100%, blue 0%, red 100%);
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkWindow">
|
||||
<property name="width_request">10</property>
|
||||
<property name="height_request">10</property>
|
||||
<property name="decorated">0</property>
|
||||
</object>
|
||||
</interface>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkWindow">
|
||||
<property name="name">test</property>
|
||||
<property name="width_request">10</property>
|
||||
<property name="height_request">10</property>
|
||||
<property name="decorated">0</property>
|
||||
</object>
|
||||
</interface>
|
@ -258,6 +258,9 @@ testdata = [
|
||||
'css-multi-state.css',
|
||||
'css-multi-state.ref.ui',
|
||||
'css-multi-state.ui',
|
||||
'css-radial-gradient-colorstop-crash.css',
|
||||
'css-radial-gradient-colorstop-crash.ref.ui',
|
||||
'css-radial-gradient-colorstop-crash.ui',
|
||||
'data-url.css',
|
||||
'data-url.ref.ui',
|
||||
'data-url.ui',
|
||||
|
Loading…
Reference in New Issue
Block a user