qt5-svg qt5-wayland rebuild
This commit is contained in:
@@ -51,7 +51,7 @@ index 0000000..b8f8f69
|
||||
+ Notice and Disclaimer - sell variant"
|
||||
+
|
||||
diff --git a/src/plugins/imageformats/svg/qsvgiohandler.cpp b/src/plugins/imageformats/svg/qsvgiohandler.cpp
|
||||
index bd39b2a..4136aaf 100644
|
||||
index bd39b2a..fd3529a 100644
|
||||
--- a/src/plugins/imageformats/svg/qsvgiohandler.cpp
|
||||
+++ b/src/plugins/imageformats/svg/qsvgiohandler.cpp
|
||||
@@ -118,6 +118,24 @@ QSvgIOHandler::~QSvgIOHandler()
|
||||
@@ -98,7 +98,16 @@ index bd39b2a..4136aaf 100644
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -260,12 +272,7 @@ bool QSvgIOHandler::supportsOption(ImageOption option) const
|
||||
@@ -177,6 +189,8 @@ bool QSvgIOHandler::read(QImage *image)
|
||||
}
|
||||
}
|
||||
if (!finalSize.isEmpty()) {
|
||||
+ if (qMax(finalSize.width(), finalSize.height()) > 0xffff)
|
||||
+ return false; // Assume corrupted file
|
||||
image->fill(d->backColor.rgba());
|
||||
QPainter p(image);
|
||||
d->r.render(&p, bounds);
|
||||
@@ -260,12 +274,7 @@ bool QSvgIOHandler::supportsOption(ImageOption option) const
|
||||
|
||||
bool QSvgIOHandler::canRead(QIODevice *device)
|
||||
{
|
||||
@@ -113,7 +122,7 @@ index bd39b2a..4136aaf 100644
|
||||
|
||||
QT_END_NAMESPACE
|
||||
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
|
||||
index c937254..b542089 100644
|
||||
index c937254..2ea80ed 100644
|
||||
--- a/src/svg/qsvghandler.cpp
|
||||
+++ b/src/svg/qsvghandler.cpp
|
||||
@@ -65,6 +65,7 @@
|
||||
@@ -175,7 +184,24 @@ index c937254..b542089 100644
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -1625,8 +1641,11 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
@@ -1611,6 +1627,7 @@ static void pathArc(QPainterPath &path,
|
||||
|
||||
static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
{
|
||||
+ const int maxElementCount = 0x7fff; // Assume file corruption if more path elements than this
|
||||
qreal x0 = 0, y0 = 0; // starting point
|
||||
qreal x = 0, y = 0; // current point
|
||||
char lastMode = 0;
|
||||
@@ -1618,28 +1635,31 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
const QChar *str = dataStr.constData();
|
||||
const QChar *end = str + dataStr.size();
|
||||
|
||||
- while (str != end) {
|
||||
+ bool ok = true;
|
||||
+ while (ok && str != end) {
|
||||
while (str->isSpace() && (str + 1) != end)
|
||||
++str;
|
||||
QChar pathElem = *str;
|
||||
++str;
|
||||
QChar endc = *end;
|
||||
*const_cast<QChar *>(end) = 0; // parseNumbersArray requires 0-termination that QStringRef cannot guarantee
|
||||
@@ -188,7 +214,170 @@ index c937254..b542089 100644
|
||||
*const_cast<QChar *>(end) = endc;
|
||||
if (pathElem == QLatin1Char('z') || pathElem == QLatin1Char('Z'))
|
||||
arg.append(0);//dummy
|
||||
@@ -2354,6 +2373,27 @@ static bool parseAnimateNode(QSvgNode *parent,
|
||||
const qreal *num = arg.constData();
|
||||
int count = arg.count();
|
||||
- while (count > 0) {
|
||||
+ while (ok && count > 0) {
|
||||
qreal offsetX = x; // correction offsets
|
||||
qreal offsetY = y; // for relative commands
|
||||
switch (pathElem.unicode()) {
|
||||
case 'm': {
|
||||
if (count < 2) {
|
||||
- num++;
|
||||
- count--;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
x = x0 = num[0] + offsetX;
|
||||
@@ -1656,8 +1676,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
break;
|
||||
case 'M': {
|
||||
if (count < 2) {
|
||||
- num++;
|
||||
- count--;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
x = x0 = num[0];
|
||||
@@ -1683,8 +1702,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
break;
|
||||
case 'l': {
|
||||
if (count < 2) {
|
||||
- num++;
|
||||
- count--;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
x = num[0] + offsetX;
|
||||
@@ -1697,8 +1715,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
break;
|
||||
case 'L': {
|
||||
if (count < 2) {
|
||||
- num++;
|
||||
- count--;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
x = num[0];
|
||||
@@ -1738,8 +1755,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
break;
|
||||
case 'c': {
|
||||
if (count < 6) {
|
||||
- num += count;
|
||||
- count = 0;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
QPointF c1(num[0] + offsetX, num[1] + offsetY);
|
||||
@@ -1755,8 +1771,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
}
|
||||
case 'C': {
|
||||
if (count < 6) {
|
||||
- num += count;
|
||||
- count = 0;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
QPointF c1(num[0], num[1]);
|
||||
@@ -1772,8 +1787,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
}
|
||||
case 's': {
|
||||
if (count < 4) {
|
||||
- num += count;
|
||||
- count = 0;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
QPointF c1;
|
||||
@@ -1794,8 +1808,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
}
|
||||
case 'S': {
|
||||
if (count < 4) {
|
||||
- num += count;
|
||||
- count = 0;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
QPointF c1;
|
||||
@@ -1816,8 +1829,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
}
|
||||
case 'q': {
|
||||
if (count < 4) {
|
||||
- num += count;
|
||||
- count = 0;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
QPointF c(num[0] + offsetX, num[1] + offsetY);
|
||||
@@ -1832,8 +1844,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
}
|
||||
case 'Q': {
|
||||
if (count < 4) {
|
||||
- num += count;
|
||||
- count = 0;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
QPointF c(num[0], num[1]);
|
||||
@@ -1848,8 +1859,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
}
|
||||
case 't': {
|
||||
if (count < 2) {
|
||||
- num += count;
|
||||
- count = 0;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
QPointF e(num[0] + offsetX, num[1] + offsetY);
|
||||
@@ -1869,8 +1879,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
}
|
||||
case 'T': {
|
||||
if (count < 2) {
|
||||
- num += count;
|
||||
- count = 0;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
QPointF e(num[0], num[1]);
|
||||
@@ -1890,8 +1899,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
}
|
||||
case 'a': {
|
||||
if (count < 7) {
|
||||
- num += count;
|
||||
- count = 0;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
qreal rx = (*num++);
|
||||
@@ -1913,8 +1921,7 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
break;
|
||||
case 'A': {
|
||||
if (count < 7) {
|
||||
- num += count;
|
||||
- count = 0;
|
||||
+ ok = false;
|
||||
break;
|
||||
}
|
||||
qreal rx = (*num++);
|
||||
@@ -1935,12 +1942,15 @@ static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
- return false;
|
||||
+ ok = false;
|
||||
+ break;
|
||||
}
|
||||
lastMode = pathElem.toLatin1();
|
||||
+ if (path.elementCount() > maxElementCount)
|
||||
+ ok = false;
|
||||
}
|
||||
}
|
||||
- return true;
|
||||
+ return ok;
|
||||
}
|
||||
|
||||
static bool parseStyle(QSvgNode *node,
|
||||
@@ -2354,6 +2364,27 @@ static bool parseAnimateNode(QSvgNode *parent,
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -216,7 +405,7 @@ index c937254..b542089 100644
|
||||
static bool parseAnimateColorNode(QSvgNode *parent,
|
||||
const QXmlStreamAttributes &attributes,
|
||||
QSvgHandler *handler)
|
||||
@@ -2387,23 +2427,13 @@ static bool parseAnimateColorNode(QSvgNode *parent,
|
||||
@@ -2387,23 +2418,13 @@ static bool parseAnimateColorNode(QSvgNode *parent,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +436,7 @@ index c937254..b542089 100644
|
||||
|
||||
QSvgAnimateColor *anim = new QSvgAnimateColor(begin, end, 0);
|
||||
anim->setArgs((targetStr == QLatin1String("fill")), colors);
|
||||
@@ -2493,24 +2523,13 @@ static bool parseAnimateTransformNode(QSvgNode *parent,
|
||||
@@ -2493,24 +2514,13 @@ static bool parseAnimateTransformNode(QSvgNode *parent,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +468,7 @@ index c937254..b542089 100644
|
||||
|
||||
QSvgAnimateTransform::TransformType type = QSvgAnimateTransform::Empty;
|
||||
if (typeStr == QLatin1String("translate")) {
|
||||
@@ -2566,6 +2585,8 @@ static QSvgNode *createCircleNode(QSvgNode *parent,
|
||||
@@ -2566,6 +2576,8 @@ static QSvgNode *createCircleNode(QSvgNode *parent,
|
||||
qreal ncx = toDouble(cx);
|
||||
qreal ncy = toDouble(cy);
|
||||
qreal nr = toDouble(r);
|
||||
@@ -288,7 +477,18 @@ index c937254..b542089 100644
|
||||
|
||||
QRectF rect(ncx-nr, ncy-nr, nr*2, nr*2);
|
||||
QSvgNode *circle = new QSvgCircle(parent, rect);
|
||||
@@ -3036,13 +3057,16 @@ static QSvgStyleProperty *createRadialGradientNode(QSvgNode *node,
|
||||
@@ -2976,8 +2988,8 @@ static QSvgNode *createPathNode(QSvgNode *parent,
|
||||
|
||||
QPainterPath qpath;
|
||||
qpath.setFillRule(Qt::WindingFill);
|
||||
- //XXX do error handling
|
||||
- parsePathDataFast(data, qpath);
|
||||
+ if (!parsePathDataFast(data, qpath))
|
||||
+ qCWarning(lcSvgHandler, "Invalid path data; path truncated.");
|
||||
|
||||
QSvgNode *path = new QSvgPath(parent, qpath);
|
||||
return path;
|
||||
@@ -3036,13 +3048,16 @@ static QSvgStyleProperty *createRadialGradientNode(QSvgNode *node,
|
||||
|
||||
qreal ncx = 0.5;
|
||||
qreal ncy = 0.5;
|
||||
@@ -306,7 +506,7 @@ index c937254..b542089 100644
|
||||
|
||||
qreal nfx = ncx;
|
||||
if (!fx.isEmpty())
|
||||
@@ -3338,7 +3362,9 @@ static QSvgNode *createTextNode(QSvgNode *parent,
|
||||
@@ -3338,7 +3353,9 @@ static QSvgNode *createTextNode(QSvgNode *parent,
|
||||
//### editable and rotate not handled
|
||||
QSvgHandler::LengthType type;
|
||||
qreal nx = parseLength(x, type, handler);
|
||||
|
||||
@@ -60,6 +60,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="23">
|
||||
<Date>2022-01-06</Date>
|
||||
<Version>5.15.2</Version>
|
||||
<Comment>Rebuild kde patch.</Comment>
|
||||
<Name>Mustafa Cinasal</Name>
|
||||
<Email>muscnsl@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="22">
|
||||
<Date>2021-11-10</Date>
|
||||
<Version>5.15.2</Version>
|
||||
|
||||
@@ -1116,6 +1116,19 @@ index 1d635f06..e2f87bbd 100644
|
||||
printf(" that->m_resource = nullptr;\n");
|
||||
printf(" }\n");
|
||||
printf(" delete resource;\n");
|
||||
diff --git a/src/shared/qwaylandinputmethodeventbuilder.cpp b/src/shared/qwaylandinputmethodeventbuilder.cpp
|
||||
index 526d0ef4..25be2509 100644
|
||||
--- a/src/shared/qwaylandinputmethodeventbuilder.cpp
|
||||
+++ b/src/shared/qwaylandinputmethodeventbuilder.cpp
|
||||
@@ -151,7 +151,7 @@ QInputMethodEvent QWaylandInputMethodEventBuilder::buildPreedit(const QString &t
|
||||
{
|
||||
QList<QInputMethodEvent::Attribute> attributes;
|
||||
|
||||
- if (m_preeditCursor < 0) {
|
||||
+ if (m_preeditCursor <= 0) {
|
||||
attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, 0, 0, QVariant()));
|
||||
} else if (m_preeditCursor > 0) {
|
||||
attributes.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, indexFromWayland(text, m_preeditCursor), 1, QVariant()));
|
||||
diff --git a/src/shared/qwaylandmimehelper.cpp b/src/shared/qwaylandmimehelper.cpp
|
||||
index a5fdd34d..051a91dc 100644
|
||||
--- a/src/shared/qwaylandmimehelper.cpp
|
||||
|
||||
@@ -85,6 +85,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="25">
|
||||
<Date>2022-01-06</Date>
|
||||
<Version>5.15.2</Version>
|
||||
<Comment>Rebuild kde patch</Comment>
|
||||
<Name>Mustafa Cinasal</Name>
|
||||
<Email>muscnsl@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="24">
|
||||
<Date>2021-12-11</Date>
|
||||
<Version>5.15.2</Version>
|
||||
|
||||
Reference in New Issue
Block a user