Hello community, here is the log from the commit of package libqt5-qtsvg for openSUSE:Factory checked in at 2019-04-26 22:53:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libqt5-qtsvg (Old) and /work/SRC/openSUSE:Factory/.libqt5-qtsvg.new.5536 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libqt5-qtsvg" Fri Apr 26 22:53:36 2019 rev:38 rq:697077 version:5.12.3 Changes: -------- --- /work/SRC/openSUSE:Factory/libqt5-qtsvg/libqt5-qtsvg.changes 2019-03-21 09:41:24.150965245 +0100 +++ /work/SRC/openSUSE:Factory/.libqt5-qtsvg.new.5536/libqt5-qtsvg.changes 2019-04-26 22:53:37.537347014 +0200 @@ -1,0 +2,8 @@ +Thu Apr 18 07:27:35 UTC 2019 - fab...@ritter-vogt.de + +- Update to 5.12.3: + * New bugfix release + * For more details please see: + * http://code.qt.io/cgit/qt/qtsvg.git/plain/dist/changes-5.12.3/?h=v5.12.3 + +------------------------------------------------------------------- Old: ---- qtsvg-everywhere-src-5.12.2.tar.xz New: ---- qtsvg-everywhere-src-5.12.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libqt5-qtsvg.spec ++++++ --- /var/tmp/diff_new_pack.pGWejb/_old 2019-04-26 22:53:38.153346617 +0200 +++ /var/tmp/diff_new_pack.pGWejb/_new 2019-04-26 22:53:38.153346617 +0200 @@ -21,16 +21,16 @@ %define libname libQt5Svg5 Name: libqt5-qtsvg -Version: 5.12.2 +Version: 5.12.3 Release: 0 Summary: Qt 5 SVG Library License: LGPL-2.1-with-Qt-Company-Qt-exception-1.1 or LGPL-3.0-only Group: Development/Libraries/X11 Url: https://www.qt.io %define base_name libqt5 -%define real_version 5.12.2 -%define so_version 5.12.2 -%define tar_version qtsvg-everywhere-src-5.12.2 +%define real_version 5.12.3 +%define so_version 5.12.3 +%define tar_version qtsvg-everywhere-src-5.12.3 Source: https://download.qt.io/official_releases/qt/5.12/%{real_version}/submodules/%{tar_version}.tar.xz Source1: baselibs.conf BuildRequires: libQt5Core-private-headers-devel >= %{version} ++++++ qtsvg-everywhere-src-5.12.2.tar.xz -> qtsvg-everywhere-src-5.12.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/.qmake.conf new/qtsvg-everywhere-src-5.12.3/.qmake.conf --- old/qtsvg-everywhere-src-5.12.2/.qmake.conf 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/.qmake.conf 2019-04-05 14:40:07.000000000 +0200 @@ -3,4 +3,4 @@ CONFIG += warning_clean DEFINES += QT_NO_FOREACH -MODULE_VERSION = 5.12.2 +MODULE_VERSION = 5.12.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/.tag new/qtsvg-everywhere-src-5.12.3/.tag --- old/qtsvg-everywhere-src-5.12.2/.tag 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/.tag 2019-04-05 14:40:07.000000000 +0200 @@ -1 +1 @@ -2430c9ed20f3f10da7bc3e7fdb5328d8501f5776 +fd12ae24b4542cf2f0df1a34187c4b8c0a408e01 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/dist/changes-5.12.3 new/qtsvg-everywhere-src-5.12.3/dist/changes-5.12.3 --- old/qtsvg-everywhere-src-5.12.2/dist/changes-5.12.3 1970-01-01 01:00:00.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/dist/changes-5.12.3 2019-04-05 14:40:07.000000000 +0200 @@ -0,0 +1,22 @@ +Qt 5.12.3 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.12.0 through 5.12.2. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + - [QTBUG-74083] Fixed leak on parsing failure. + - [QTBUG-74129] Fixed possible heap overflow in path parsing. + - [QTBUG-74189] Fixed crash with recursive gradient references. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvgfont_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvgfont_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvgfont_p.h 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvgfont_p.h 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -#include "../../../../../src/svg/qsvgfont_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvggraphics_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvggraphics_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvggraphics_p.h 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvggraphics_p.h 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -#include "../../../../../src/svg/qsvggraphics_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvghandler_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvghandler_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvghandler_p.h 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvghandler_p.h 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -#include "../../../../../src/svg/qsvghandler_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvgnode_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvgnode_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvgnode_p.h 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvgnode_p.h 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -#include "../../../../../src/svg/qsvgnode_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvgstructure_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvgstructure_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvgstructure_p.h 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvgstructure_p.h 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -#include "../../../../../src/svg/qsvgstructure_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvgstyle_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvgstyle_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvgstyle_p.h 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvgstyle_p.h 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -#include "../../../../../src/svg/qsvgstyle_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvgtinydocument_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvgtinydocument_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qsvgtinydocument_p.h 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qsvgtinydocument_p.h 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -#include "../../../../../src/svg/qsvgtinydocument_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qtsvgglobal_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qtsvgglobal_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.2/QtSvg/private/qtsvgglobal_p.h 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.2/QtSvg/private/qtsvgglobal_p.h 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -#include "../../../../../src/svg/qtsvgglobal_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvgfont_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvgfont_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvgfont_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvgfont_p.h 2019-04-05 14:40:07.000000000 +0200 @@ -0,0 +1 @@ +#include "../../../../../src/svg/qsvgfont_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvggraphics_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvggraphics_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvggraphics_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvggraphics_p.h 2019-04-05 14:40:07.000000000 +0200 @@ -0,0 +1 @@ +#include "../../../../../src/svg/qsvggraphics_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvghandler_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvghandler_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvghandler_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvghandler_p.h 2019-04-05 14:40:07.000000000 +0200 @@ -0,0 +1 @@ +#include "../../../../../src/svg/qsvghandler_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvgnode_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvgnode_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvgnode_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvgnode_p.h 2019-04-05 14:40:07.000000000 +0200 @@ -0,0 +1 @@ +#include "../../../../../src/svg/qsvgnode_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvgstructure_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvgstructure_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvgstructure_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvgstructure_p.h 2019-04-05 14:40:07.000000000 +0200 @@ -0,0 +1 @@ +#include "../../../../../src/svg/qsvgstructure_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvgstyle_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvgstyle_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvgstyle_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvgstyle_p.h 2019-04-05 14:40:07.000000000 +0200 @@ -0,0 +1 @@ +#include "../../../../../src/svg/qsvgstyle_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvgtinydocument_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvgtinydocument_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qsvgtinydocument_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qsvgtinydocument_p.h 2019-04-05 14:40:07.000000000 +0200 @@ -0,0 +1 @@ +#include "../../../../../src/svg/qsvgtinydocument_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qtsvgglobal_p.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qtsvgglobal_p.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/5.12.3/QtSvg/private/qtsvgglobal_p.h 1970-01-01 01:00:00.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/5.12.3/QtSvg/private/qtsvgglobal_p.h 2019-04-05 14:40:07.000000000 +0200 @@ -0,0 +1 @@ +#include "../../../../../src/svg/qtsvgglobal_p.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/include/QtSvg/qtsvgversion.h new/qtsvg-everywhere-src-5.12.3/include/QtSvg/qtsvgversion.h --- old/qtsvg-everywhere-src-5.12.2/include/QtSvg/qtsvgversion.h 2019-03-11 14:30:13.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/include/QtSvg/qtsvgversion.h 2019-04-11 20:20:29.000000000 +0200 @@ -2,8 +2,8 @@ #ifndef QT_QTSVG_VERSION_H #define QT_QTSVG_VERSION_H -#define QTSVG_VERSION_STR "5.12.2" +#define QTSVG_VERSION_STR "5.12.3" -#define QTSVG_VERSION 0x050C02 +#define QTSVG_VERSION 0x050C03 #endif // QT_QTSVG_VERSION_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/src/svg/qsvghandler.cpp new/qtsvg-everywhere-src-5.12.3/src/svg/qsvghandler.cpp --- old/qtsvg-everywhere-src-5.12.2/src/svg/qsvghandler.cpp 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/src/svg/qsvghandler.cpp 2019-04-05 14:40:07.000000000 +0200 @@ -774,21 +774,31 @@ static QString idFromUrl(const QString &url) { + // The form is url(<IRI>), where IRI can be + // just an ID on #<id> form. QString::const_iterator itr = url.constBegin(); QString::const_iterator end = url.constEnd(); + QString id; while (itr != end && (*itr).isSpace()) ++itr; if (itr != end && (*itr) == QLatin1Char('(')) ++itr; + else + return QString(); while (itr != end && (*itr).isSpace()) ++itr; - if (itr != end && (*itr) == QLatin1Char('#')) + if (itr != end && (*itr) == QLatin1Char('#')) { + id += *itr; ++itr; - QString id; + } else { + return QString(); + } while (itr != end && (*itr) != QLatin1Char(')')) { id += *itr; ++itr; } + if (itr == end || (*itr) != QLatin1Char(')')) + return QString(); return id; } @@ -1596,7 +1606,7 @@ 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 +3719,20 @@ } 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()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/src/svg/qsvgstyle.cpp new/qtsvg-everywhere-src-5.12.3/src/svg/qsvgstyle.cpp --- old/qtsvg-everywhere-src-5.12.2/src/svg/qsvgstyle.cpp 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/src/svg/qsvgstyle.cpp 2019-04-05 14:40:07.000000000 +0200 @@ -942,13 +942,20 @@ void QSvgGradientStyle::resolveStops() { + QStringList visited; + resolveStops_helper(&visited); +} + +void QSvgGradientStyle::resolveStops_helper(QStringList *visited) +{ if (!m_link.isEmpty() && m_doc) { QSvgStyleProperty *prop = m_doc->styleProperty(m_link); - if (prop && prop != this) { + if (prop && !visited->contains(m_link)) { + visited->append(m_link); if (prop->type() == QSvgStyleProperty::GRADIENT) { QSvgGradientStyle *st = static_cast<QSvgGradientStyle*>(prop); - st->resolveStops(); + st->resolveStops_helper(visited); m_gradient->setStops(st->qgradient()->stops()); m_gradientStopsSet = st->gradientStopsSet(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/src/svg/qsvgstyle_p.h new/qtsvg-everywhere-src-5.12.3/src/svg/qsvgstyle_p.h --- old/qtsvg-everywhere-src-5.12.2/src/svg/qsvgstyle_p.h 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/src/svg/qsvgstyle_p.h 2019-04-05 14:40:07.000000000 +0200 @@ -577,6 +577,7 @@ void setStopLink(const QString &link, QSvgTinyDocument *doc); QString stopLink() const { return m_link; } void resolveStops(); + void resolveStops_helper(QStringList *visited); void setMatrix(const QMatrix &matrix); QMatrix qmatrix() const diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/src/svg/qsvgtinydocument.cpp new/qtsvg-everywhere-src-5.12.3/src/svg/qsvgtinydocument.cpp --- old/qtsvg-everywhere-src-5.12.2/src/svg/qsvgtinydocument.cpp 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/src/svg/qsvgtinydocument.cpp 2019-04-05 14:40:07.000000000 +0200 @@ -187,6 +187,7 @@ } else { qCWarning(lcSvgHandler, "Cannot read file '%s', because: %s (line %d)", qPrintable(fileName), qPrintable(handler.errorString()), handler.lineNumber()); + delete handler.document(); } return doc; } @@ -207,6 +208,8 @@ if (handler.ok()) { doc = handler.document(); doc->m_animationDuration = handler.animationDuration(); + } else { + delete handler.document(); } return doc; } @@ -219,6 +222,8 @@ if (handler.ok()) { doc = handler.document(); doc->m_animationDuration = handler.animationDuration(); + } else { + delete handler.document(); } return doc; } @@ -358,7 +363,10 @@ void QSvgTinyDocument::addNamedStyle(const QString &id, QSvgFillStyleProperty *style) { - m_namedStyles.insert(id, style); + if (!m_namedStyles.contains(id)) + m_namedStyles.insert(id, style); + else + qCWarning(lcSvgHandler) << "Duplicate unique style id:" << id; } QSvgFillStyleProperty *QSvgTinyDocument::namedStyle(const QString &id) const @@ -455,7 +463,7 @@ t *= node->m_style.transform->qtransform(); node = node->parent(); } - + return t.toAffine(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtsvg-everywhere-src-5.12.2/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp new/qtsvg-everywhere-src-5.12.3/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp --- old/qtsvg-everywhere-src-5.12.2/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp 2019-02-21 09:16:48.000000000 +0100 +++ new/qtsvg-everywhere-src-5.12.3/tests/auto/qsvgrenderer/tst_qsvgrenderer.cpp 2019-04-05 14:40:07.000000000 +0200 @@ -67,6 +67,8 @@ void boundsOnElement() const; void gradientStops() const; void gradientRefs(); + void recursiveRefs_data(); + void recursiveRefs(); void fillRule(); void opacity(); void paths(); @@ -77,6 +79,7 @@ void testUseElement(); void smallFont(); void styleSheet(); + void duplicateStyleId(); #ifndef QT_NO_COMPRESS void testGzLoading(); @@ -139,22 +142,28 @@ { QTest::addColumn<QByteArray>("svg"); - QTest::newRow("00") << QByteArray("<svg><circle fill=\"url\" /></svg>"); - QTest::newRow("01") << QByteArray("<svg><circle fill=\"url0\" /></svg>"); - QTest::newRow("02") << QByteArray("<svg><circle fill=\"url(0\" /></svg>"); - QTest::newRow("03") << QByteArray("<svg><circle fill=\"url (0\" /></svg>"); - QTest::newRow("04") << QByteArray("<svg><circle fill=\"url ( 0\" /></svg>"); - QTest::newRow("05") << QByteArray("<svg><circle fill=\"url#\" /></svg>"); - QTest::newRow("06") << QByteArray("<svg><circle fill=\"url#(\" /></svg>"); - QTest::newRow("07") << QByteArray("<svg><circle fill=\"url(#\" /></svg>"); - QTest::newRow("08") << QByteArray("<svg><circle fill=\"url(# \" /></svg>"); - QTest::newRow("09") << QByteArray("<svg><circle fill=\"url(# 0\" /></svg>"); + QTest::newRow("01") << QByteArray("<svg><linearGradient id=\"0\"/><circle fill=\"url0\" /></svg>"); + QTest::newRow("02") << QByteArray("<svg><linearGradient id=\"0\"/><circle fill=\"url(0\" /></svg>"); + QTest::newRow("03") << QByteArray("<svg><linearGradient id=\"0\"/><circle fill=\"url (0\" /></svg>"); + QTest::newRow("04") << QByteArray("<svg><linearGradient id=\"0\"/><circle fill=\"url ( 0\" /></svg>"); + QTest::newRow("05") << QByteArray("<svg><linearGradient id=\"0\"/><circle fill=\"url#\" /></svg>"); + QTest::newRow("06") << QByteArray("<svg><linearGradient id=\"0\"/><circle fill=\"url#(\" /></svg>"); + QTest::newRow("07") << QByteArray("<svg><linearGradient id=\"0\"/><circle fill=\"url(#\" /></svg>"); + QTest::newRow("08") << QByteArray("<svg><linearGradient id=\"0\"/><circle fill=\"url(# \" /></svg>"); + QTest::newRow("09") << QByteArray("<svg><linearGradient id=\"0\"/><circle fill=\"url(# 0\" /></svg>"); + QTest::newRow("10") << QByteArray("<svg><linearGradient id=\"blabla\"/><circle fill=\"urlblabla\" /></svg>"); + QTest::newRow("11") << QByteArray("<svg><linearGradient id=\"blabla\"/><circle fill=\"url(blabla\" /></svg>"); + QTest::newRow("12") << QByteArray("<svg><linearGradient id=\"blabla\"/><circle fill=\"url(blabla)\" /></svg>"); + QTest::newRow("13") << QByteArray("<svg><linearGradient id=\"blabla\"/><circle fill=\"url(#blabla\" /></svg>"); } void tst_QSvgRenderer::invalidUrl() { QFETCH(QByteArray, svg); +#if QT_CONFIG(regularexpression) + QTest::ignoreMessage(QtWarningMsg, QRegularExpression("Could not resolve property")); +#endif QSvgRenderer renderer(svg); QVERIFY(renderer.isValid()); } @@ -667,6 +676,43 @@ } } +void tst_QSvgRenderer::recursiveRefs_data() +{ + QTest::addColumn<QByteArray>("svg"); + + QTest::newRow("single") << QByteArray("<svg>" + "<linearGradient id='0' xlink:href='#0'/>" + "<rect x='0' y='0' width='20' height='20' fill='url(#0)'/>" + "</svg>"); + + QTest::newRow("double") << QByteArray("<svg>" + "<linearGradient id='0' xlink:href='#1'/>" + "<linearGradient id='1' xlink:href='#0'/>" + "<rect x='0' y='0' width='20' height='20' fill='url(#0)'/>" + "</svg>"); + + QTest::newRow("triple") << QByteArray("<svg>" + "<linearGradient id='0' xlink:href='#1'/>" + "<linearGradient id='1' xlink:href='#2'/>" + "<linearGradient id='2' xlink:href='#0'/>" + "<rect x='0' y='0' width='20' height='20' fill='url(#0)'/>" + "</svg>"); +} + +void tst_QSvgRenderer::recursiveRefs() +{ + QFETCH(QByteArray, svg); + + QImage image(20, 20, QImage::Format_ARGB32_Premultiplied); + image.fill(Qt::green); + QImage refImage = image.copy(); + + QSvgRenderer renderer(svg); + QPainter painter(&image); + renderer.render(&painter); + QCOMPARE(image, refImage); +} + #ifndef QT_NO_COMPRESS void tst_QSvgRenderer::testGzLoading() @@ -1459,5 +1505,17 @@ QCOMPARE(images[0], images[1]); } +void tst_QSvgRenderer::duplicateStyleId() +{ + QByteArray svg = QByteArrayLiteral("<svg><linearGradient id=\"a\"/>" + "<rect style=\"fill:url(#a)\"/>" + "<linearGradient id=\"a\"/></svg>"); + QTest::ignoreMessage(QtWarningMsg, "Duplicate unique style id: \"a\""); + QImage image(200, 200, QImage::Format_RGB32); + QPainter painter(&image); + QSvgRenderer renderer(svg); + renderer.render(&painter); +} + QTEST_MAIN(tst_QSvgRenderer) #include "tst_qsvgrenderer.moc"