diff --git a/src/common/tvgStr.cpp b/src/common/tvgStr.cpp index 311b9865..1336f244 100644 --- a/src/common/tvgStr.cpp +++ b/src/common/tvgStr.cpp @@ -21,6 +21,7 @@ */ #include "config.h" +#include #include #include #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: