mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-03 06:38:06 +02:00
default-context: Do not allow restoring pushed gstates
The brackets defined by push/pop and save/restore are independent ad should match properly. This means that cairo_push()-ed gstates cannot be cairo_restore()-d and cairo_save()-d gstates cannot be cairo_pop()-ed. Fixes group-state.
This commit is contained in:
parent
0ae32437af
commit
6155348966
1 changed files with 3 additions and 0 deletions
|
|
@ -119,6 +119,9 @@ _cairo_default_context_restore (void *abstract_cr)
|
|||
{
|
||||
cairo_default_context_t *cr = abstract_cr;
|
||||
|
||||
if (unlikely (_cairo_gstate_is_group (cr->gstate)))
|
||||
return _cairo_error (CAIRO_STATUS_INVALID_RESTORE);
|
||||
|
||||
return _cairo_gstate_restore (&cr->gstate, &cr->gstate_freelist);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue