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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user