summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/svg/qsvghandler.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index 038aeb4..b6e771f 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -3525,7 +3525,11 @@ void QSvgHandler::parse()
// namespaceUri is empty. The only possible strategy at
// this point is to do what everyone else seems to do and
// ignore the reported namespaceUri completely.
- startElement(xml->name().toString(), xml->attributes());
+ if (!startElement(xml->name().toString(), xml->attributes())) {
+ delete m_doc;
+ m_doc = 0;
+ return;
+ }
break;
case QXmlStreamReader::EndElement:
endElement(xml->name());
@@ -3570,6 +3574,9 @@ bool QSvgHandler::startElement(const QString &localName,
m_whitespaceMode.push(QSvgText::Default);
}
+ if (!m_doc && localName != QLatin1String("svg"))
+ return false;
+
if (FactoryMethod method = findGroupFactory(localName)) {
//group
node = method(m_doc ? m_nodes.top() : 0, attributes, this);