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,