diff --git a/mozilla/content/svg/content/src/nsSVGPathElement.cpp b/mozilla/content/svg/content/src/nsSVGPathElement.cpp index 94b6b46765d..525a5992fd8 100644 --- a/mozilla/content/svg/content/src/nsSVGPathElement.cpp +++ b/mozilla/content/svg/content/src/nsSVGPathElement.cpp @@ -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; } diff --git a/mozilla/layout/svg/base/src/nsSVGMaskFrame.cpp b/mozilla/layout/svg/base/src/nsSVGMaskFrame.cpp index 384a77761f4..253908cd874 100644 --- a/mozilla/layout/svg/base/src/nsSVGMaskFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGMaskFrame.cpp @@ -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);