summaryrefslogtreecommitdiff
path: root/src/svg/qsvghandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/svg/qsvghandler.cpp')
-rw-r--r--src/svg/qsvghandler.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
index dd31965..463ec01 100644
--- a/src/svg/qsvghandler.cpp
+++ b/src/svg/qsvghandler.cpp
@@ -1596,7 +1596,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
const QChar *end = str + dataStr.size();
while (str != end) {
- while (str->isSpace())
+ while (str->isSpace() && (str + 1) != end)
++str;
QChar pathElem = *str;
++str;
@@ -3709,14 +3709,20 @@ bool QSvgHandler::startElement(const QString &localName,
}
break;
default:
+ const QByteArray msg = QByteArrayLiteral("Could not add child element to parent element because the types are incorrect.");
+ qCWarning(lcSvgHandler, "%s", prefixMessage(msg, xml).constData());
+ delete node;
+ node = 0;
break;
}
}
- parseCoreNode(node, attributes);
+ if (node) {
+ parseCoreNode(node, attributes);
#ifndef QT_NO_CSSPARSER
- cssStyleLookup(node, this, m_selector);
+ cssStyleLookup(node, this, m_selector);
#endif
- parseStyle(node, attributes, this);
+ parseStyle(node, attributes, this);
+ }
} else if (FactoryMethod method = findGraphicsFactory(localName)) {
//rendering element
Q_ASSERT(!m_nodes.isEmpty());