From 6940bbb1dd4a1c51c9b158da9347c843ecf29c2e Mon Sep 17 00:00:00 2001 From: "tor%cs.brown.edu" Date: Thu, 5 May 2005 19:55:32 +0000 Subject: [PATCH] Bug 292222 - crash on some svg with no gdi+. r=afri, a=asa --- layout/svg/base/src/nsSVGGlyphFrame.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/layout/svg/base/src/nsSVGGlyphFrame.cpp b/layout/svg/base/src/nsSVGGlyphFrame.cpp index 3040cbb39bff..f5984d6f7263 100644 --- a/layout/svg/base/src/nsSVGGlyphFrame.cpp +++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp @@ -284,16 +284,15 @@ nsSVGGlyphFrame::Init(nsPresContext* aPresContext, } nsCOMPtr renderer; outerSVGFrame->GetRenderer(getter_AddRefs(renderer)); - if (!renderer) return NS_ERROR_FAILURE; - - renderer->CreateGlyphMetrics(this, getter_AddRefs(mMetrics)); - if (!mMetrics) return NS_ERROR_FAILURE; - - renderer->CreateGlyphGeometry(this, getter_AddRefs(mGeometry)); - if (!mGeometry) return NS_ERROR_FAILURE; - + if (renderer) { + renderer->CreateGlyphMetrics(this, getter_AddRefs(mMetrics)); + renderer->CreateGlyphGeometry(this, getter_AddRefs(mGeometry)); + } SetStyleContext(aPresContext, aContext); + + if (!renderer || !mMetrics || !mGeometry) + return NS_ERROR_FAILURE; return NS_OK; }