mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-08 14:10:26 +01:00
[cairo-ps-surface] Check error status before potential illegal dereference.
After acquiring the source image, check for the error status to ensure that we do not attempt to deference an invalid surface.
This commit is contained in:
parent
767add1ee3
commit
ba2e82d138
1 changed files with 7 additions and 1 deletions
|
|
@ -2142,17 +2142,23 @@ _cairo_ps_surface_acquire_surface (cairo_ps_surface_t *surface,
|
|||
cairo_rectangle_int_t pattern_extents;
|
||||
|
||||
status = _cairo_surface_get_extents (meta_surface, &pattern_extents);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
*width = pattern_extents.width;
|
||||
*height = pattern_extents.height;
|
||||
} else {
|
||||
status = _cairo_surface_acquire_source_image (pattern->surface,
|
||||
&surface->image,
|
||||
&surface->image_extra);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
*width = surface->image->width;
|
||||
*height = surface->image->height;
|
||||
}
|
||||
|
||||
return status;
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static cairo_status_t
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue