[cairo-svg-surface] Check surface status before extracting the svg target.

We need to check and report the existent status, else we may try to
modify the inert error object.
This commit is contained in:
Chris Wilson 2008-03-31 19:15:48 +01:00
parent 013bbda637
commit 0cd42c25a6

View file

@ -233,10 +233,15 @@ _extract_svg_surface (cairo_surface_t *surface,
{
cairo_surface_t *target;
if (surface->status)
return surface->status;
if (! _cairo_surface_is_paginated (surface))
return _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);
target = _cairo_paginated_surface_get_target (surface);
if (target->status)
return target->status;
if (! _cairo_surface_is_svg (target))
return _cairo_error (CAIRO_STATUS_SURFACE_TYPE_MISMATCH);