Fix build error: CMake Error at /usr/lib/cmake/Qt5Svg/Qt5SvgConfig.cmake:111 (find_package): Could not find a configuration file for package "Qt5Widgets" that is compatible with requested version "5.15.3". The following configuration files were considered but not accepted: /usr/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake, version: 5.15.2 MR for Alpine: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/20307 [ci:skip-vercheck]: pkgrel>0 on purpose
42 lines
1.2 KiB
Diff
42 lines
1.2 KiB
Diff
From aceea78cc05ac8ff947cee9de8149b48771781a8 Mon Sep 17 00:00:00 2001
|
|
From: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
|
Date: Tue, 1 Dec 2020 14:39:59 +0100
|
|
Subject: [PATCH 4/5] Improve handling of malformed numeric values in svg files
|
|
|
|
Catch cases where the input is not containable in a qreal, and avoid
|
|
passing on inf values.
|
|
|
|
Change-Id: I1ab8932d94473916815385240c29e03afb0e0c9e
|
|
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
|
|
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
|
|
(cherry picked from commit 428d56da9d5ed9bda51f7cc3c144996fb3a6a285)
|
|
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
|
|
---
|
|
src/svg/qsvghandler.cpp | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp
|
|
index c937254..b3d9aaf 100644
|
|
--- a/src/svg/qsvghandler.cpp
|
|
+++ b/src/svg/qsvghandler.cpp
|
|
@@ -65,6 +65,7 @@
|
|
#include "private/qmath_p.h"
|
|
|
|
#include "float.h"
|
|
+#include <cmath>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
@@ -672,6 +673,8 @@ static qreal toDouble(const QChar *&str)
|
|
val = -val;
|
|
} else {
|
|
val = QByteArray::fromRawData(temp, pos).toDouble();
|
|
+ if (qFpClassify(val) != FP_NORMAL)
|
|
+ val = 0;
|
|
}
|
|
return val;
|
|
|
|
--
|
|
2.31.1
|
|
|