aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtsvg/0001-Clamp-parsed-doubles-to-float-representable-values.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-qt/qt5/qtsvg/0001-Clamp-parsed-doubles-to-float-representable-values.patch')
-rw-r--r--recipes-qt/qt5/qtsvg/0001-Clamp-parsed-doubles-to-float-representable-values.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtsvg/0001-Clamp-parsed-doubles-to-float-representable-values.patch b/recipes-qt/qt5/qtsvg/0001-Clamp-parsed-doubles-to-float-representable-values.patch
new file mode 100644
index 00000000..1b96635c
--- /dev/null
+++ b/recipes-qt/qt5/qtsvg/0001-Clamp-parsed-doubles-to-float-representable-values.patch
@@ -0,0 +1,44 @@
+From 861999c07eca77807bb000939406d07bfec8e419 Mon Sep 17 00:00:00 2001
+From: Allan Sandfeld Jensen <allan.jensen@qt.io>
+Date: Thu, 4 Mar 2021 14:28:48 +0100
+Subject: [PATCH] Clamp parsed doubles to float representable values
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Parts of our rendering assumes incoming doubles can still be sane
+floats.
+
+Pick-to: 6.1 6.0 5.15 5.12
+Fixes: QTBUG-91507
+Change-Id: I7086a121e1b5ed47695a1251ea90e774dd8f148d
+Reviewed-by: Robert Löhning <robert.loehning@qt.io>
+Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
+Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
+---
+ src/svg/qsvghandler.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
+index b3d9aaf..9dac05c 100644
+--- a/src/svg/qsvghandler.cpp
++++ b/src/svg/qsvghandler.cpp
+@@ -673,7 +673,8 @@ static qreal toDouble(const QChar *&str)
+ val = -val;
+ } else {
+ val = QByteArray::fromRawData(temp, pos).toDouble();
+- if (qFpClassify(val) != FP_NORMAL)
++ // Do not tolerate values too wild to be represented normally by floats
++ if (qFpClassify(float(val)) != FP_NORMAL)
+ val = 0;
+ }
+ return val;
+@@ -3046,6 +3047,8 @@ static QSvgStyleProperty *createRadialGradientNode(QSvgNode *node,
+ ncy = toDouble(cy);
+ if (!r.isEmpty())
+ nr = toDouble(r);
++ if (nr < 0.5)
++ nr = 0.5;
+
+ qreal nfx = ncx;
+ if (!fx.isEmpty())