Bug 360122 - correct cairo_create error checking.

Patch by amenzie@us.ibm.com, r=tor, sr=roc


git-svn-id: svn://10.0.0.236/trunk@215599 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
tor%cs.brown.edu
2006-11-21 23:57:56 +00:00
parent a0851bd5c1
commit 3c37477ebe
2 changed files with 7 additions and 2 deletions

View File

@@ -480,7 +480,8 @@ nsSVGPathElement::GetFlattenedPath(nsIDOMSVGMatrix *aMatrix)
return nsnull;
cairo_t *ctx = cairo_create(dummySurface);
if (!ctx) {
if (cairo_status(ctx) != CAIRO_STATUS_SUCCESS) {
cairo_destroy(ctx);
cairo_surface_destroy(dummySurface);
return nsnull;
}

View File

@@ -241,8 +241,12 @@ nsSVGMaskFrame::ComputeMaskAlpha(nsISVGRendererCanvas* aCanvas,
return nsnull;
cairo_t *transferCtx = cairo_create(image);
if (!transferCtx)
if (cairo_status(transferCtx) != CAIRO_STATUS_SUCCESS) {
cairo_destroy(transferCtx);
cairo_surface_destroy(image);
cairo_pattern_destroy(pattern);
return nsnull;
}
cairo_set_source_surface(transferCtx, surface, 0, 0);
cairo_paint(transferCtx);