[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:
Chris Wilson 2008-03-31 10:55:39 +01:00
parent 767add1ee3
commit ba2e82d138

View file

@ -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