summaryrefslogtreecommitdiffstats
path: root/thirdparty/thorvg/src/common/tvgStr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/thorvg/src/common/tvgStr.cpp')
-rw-r--r--thirdparty/thorvg/src/common/tvgStr.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/thirdparty/thorvg/src/common/tvgStr.cpp b/thirdparty/thorvg/src/common/tvgStr.cpp
index 311b986511..1336f2447c 100644
--- a/thirdparty/thorvg/src/common/tvgStr.cpp
+++ b/thirdparty/thorvg/src/common/tvgStr.cpp
@@ -21,6 +21,7 @@
*/
#include "config.h"
+#include <cmath>
#include <cstring>
#include <memory.h>
#include "tvgMath.h"
@@ -197,6 +198,8 @@ float strToFloat(const char *nPtr, char **endPtr)
success:
if (endPtr) *endPtr = (char *)(a);
+ if (!std::isfinite(val)) return 0.0f;
+
return minus * val;
error: