From 3d42c1fc15c4c2dacf5da7d6555e3fc7ac10416c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 9 Feb 2016 09:56:43 +0000 Subject: [PATCH] crashtesting: crash on loading moz330387-6.svg Change-Id: I9bba4cd9332320285c06ca3ba8eaf94ab89dfeef --- filter/source/svg/svgreader.cxx | 45 ++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index f3aeb17022c2..243aa2cc07b3 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -348,29 +348,32 @@ struct AnnotatingVisitor } case XML_STOP: { - const sal_Int32 nNumAttrs( xAttributes->getLength() ); - maGradientStopVector.push_back(GradientStop()); - maGradientVector.back().maStops.push_back(maGradientStopVector.size()-1); - - // first parse 'color' as 'stop-color' might depend on it - // if 'stop-color''s value is "currentColor" and parsed previously - uno::Reference xNodeColor(xAttributes->getNamedItem("color")); - if(xNodeColor.is()) - parseGradientStop( maGradientStopVector.back(), - maGradientStopVector.size()-1, - XML_STOP_COLOR, - xNodeColor->getNodeValue() ); - - //now, parse the rest of attributes - for( sal_Int32 i=0; iitem(i)->getNodeName())); - if ( nTokenId != XML_COLOR ) + const sal_Int32 nNumAttrs( xAttributes->getLength() ); + maGradientStopVector.push_back(GradientStop()); + maGradientVector.back().maStops.push_back(maGradientStopVector.size()-1); + + // first parse 'color' as 'stop-color' might depend on it + // if 'stop-color''s value is "currentColor" and parsed previously + uno::Reference xNodeColor(xAttributes->getNamedItem("color")); + if(xNodeColor.is()) parseGradientStop( maGradientStopVector.back(), - maGradientStopVector.size()-1, - nTokenId, - xAttributes->item(i)->getNodeValue() ); + maGradientStopVector.size()-1, + XML_STOP_COLOR, + xNodeColor->getNodeValue() ); + + //now, parse the rest of attributes + for( sal_Int32 i=0; iitem(i)->getNodeName())); + if ( nTokenId != XML_COLOR ) + parseGradientStop( maGradientStopVector.back(), + maGradientStopVector.size()-1, + nTokenId, + xAttributes->item(i)->getNodeValue() ); + } } break; }