diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2022-01-05 09:48:22 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-05 13:09:41 +0000 |
commit | 980b4d27bdff67a822aa48d321db4d240399440f (patch) | |
tree | df7f3c229cba18f8f34f378cc83410d7adeb0493 | |
parent | f91300ddd7cbe28df18cb8b1b09942c930260575 (diff) | |
download | qtsvg-980b4d27bdff67a822aa48d321db4d240399440f.tar.gz |
Unconditionally stop parsing after the svg end tag
A QSvghandler may be created either with an external QXmlStreamReader
object, or with a bytearray/iodevice, in which case it will create its
own stream reader. The check to end parisng at the </svg> tag was
active only in the first case. This could result in different behavior
when reading an svg image from file vs. reading it from a bytearray
or resource.
Fixes: QTBUG-99407
Change-Id: I187b39256f2b16ea952a3ae1b77c067ff96e4155
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
(cherry picked from commit 1749388cdc765fca4206aaf0f84ac9b0877dfc9a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/svg/qsvghandler.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index b303ca7..07926a5 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -3686,9 +3686,7 @@ void QSvgHandler::parse() case QXmlStreamReader::EndElement: endElement(xml->name()); ++remainingUnfinishedElements; - // if we are using somebody else's qxmlstreamreader - // we should not read until the end of the stream - done = !m_ownsReader && (xml->name() == QLatin1String("svg")); + done = (xml->name() == QLatin1String("svg")); break; case QXmlStreamReader::Characters: characters(xml->text()); |