From 4c6c3b179413c37aae71901ff8e0457b034d6ab1 Mon Sep 17 00:00:00 2001 From: "tor%cs.brown.edu" Date: Sun, 21 May 2006 13:50:39 +0000 Subject: [PATCH] Bug 338281 - Properly invalidate path when parsing fails. r+sr=roc --- content/svg/content/src/nsSVGPathDataParser.cpp | 2 ++ content/svg/content/src/nsSVGPathElement.cpp | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/svg/content/src/nsSVGPathDataParser.cpp b/content/svg/content/src/nsSVGPathDataParser.cpp index c52c88c93e06..6c73807ba7e8 100644 --- a/content/svg/content/src/nsSVGPathDataParser.cpp +++ b/content/svg/content/src/nsSVGPathDataParser.cpp @@ -1144,6 +1144,8 @@ nsSVGPathDataParserToInternal::Parse(const nsAString &aValue) mPrevSeg = nsIDOMSVGPathSeg::PATHSEG_UNKNOWN; nsresult rv = nsSVGPathDataParser::Parse(aValue); + if (NS_FAILED(rv)) + mPathData->Clear(); PathFini(); diff --git a/content/svg/content/src/nsSVGPathElement.cpp b/content/svg/content/src/nsSVGPathElement.cpp index 501db668b223..8adf9462c327 100644 --- a/content/svg/content/src/nsSVGPathElement.cpp +++ b/content/svg/content/src/nsSVGPathElement.cpp @@ -342,9 +342,7 @@ nsSVGPathElement::BeforeSetAttr(PRInt32 aNamespaceID, nsIAtom* aName, } nsSVGPathDataParserToInternal parser(&mPathData); - nsresult rv = parser.Parse(*aValue); - - NS_ENSURE_SUCCESS(rv, rv); + parser.Parse(*aValue); } return nsSVGPathElementBase::BeforeSetAttr(aNamespaceID, aName,