summaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-02-09 09:56:43 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-02-09 10:10:34 +0000
commit3d42c1fc15c4c2dacf5da7d6555e3fc7ac10416c (patch)
treef70ae63cfcbdd96a20069d61a4f6e13f276ff709 /filter
parentxmlsecurity: some streams should not be signed in OOXML export (diff)
downloadcore-3d42c1fc15c4c2dacf5da7d6555e3fc7ac10416c.tar.gz
core-3d42c1fc15c4c2dacf5da7d6555e3fc7ac10416c.zip
crashtesting: crash on loading moz330387-6.svg
Change-Id: I9bba4cd9332320285c06ca3ba8eaf94ab89dfeef
Diffstat (limited to 'filter')
-rw-r--r--filter/source/svg/svgreader.cxx45
1 files 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<xml::dom::XNode> 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; i<nNumAttrs; ++i )
+ if (!maGradientVector.empty())
{
- const sal_Int32 nTokenId(
- getTokenId(xAttributes->item(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<xml::dom::XNode> 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; i<nNumAttrs; ++i )
+ {
+ const sal_Int32 nTokenId(
+ getTokenId(xAttributes->item(i)->getNodeName()));
+ if ( nTokenId != XML_COLOR )
+ parseGradientStop( maGradientStopVector.back(),
+ maGradientStopVector.size()-1,
+ nTokenId,
+ xAttributes->item(i)->getNodeValue() );
+ }
}
break;
}