mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-17 18:50:24 +01:00
Fix theoretical NULL return from cairo_pop_group()
This also makes the code more consistent as group_pattern always holds a valid pattern.
This commit is contained in:
parent
5eae45c55b
commit
dca93eb76d
1 changed files with 3 additions and 3 deletions
|
|
@ -549,11 +549,11 @@ cairo_pattern_t *
|
|||
cairo_pop_group (cairo_t *cr)
|
||||
{
|
||||
cairo_surface_t *group_surface, *parent_target;
|
||||
cairo_pattern_t *group_pattern = NULL;
|
||||
cairo_pattern_t *group_pattern = (cairo_pattern_t*) &_cairo_pattern_nil.base;
|
||||
cairo_matrix_t group_matrix;
|
||||
|
||||
if (cr->status)
|
||||
return (cairo_pattern_t*) &_cairo_pattern_nil.base;
|
||||
return group_pattern;
|
||||
|
||||
/* Grab the active surfaces */
|
||||
group_surface = _cairo_gstate_get_target (cr->gstate);
|
||||
|
|
@ -562,7 +562,7 @@ cairo_pop_group (cairo_t *cr)
|
|||
/* Verify that we are at the right nesting level */
|
||||
if (parent_target == NULL) {
|
||||
_cairo_set_error (cr, CAIRO_STATUS_INVALID_POP_GROUP);
|
||||
return (cairo_pattern_t*) &_cairo_pattern_nil.base;
|
||||
return group_pattern;
|
||||
}
|
||||
|
||||
/* We need to save group_surface before we restore; we don't need
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue