From 439c91855338131627181e17cff961a0461d9f1a Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Mon, 12 Dec 2022 15:08:06 +0900 Subject: [PATCH] common Util: Skip if there is a space after the dot Some SVG parsers allow parsing of "0." If there is a space after the dot, skip to the next step. --- src/loaders/svg/tvgSvgUtil.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/loaders/svg/tvgSvgUtil.cpp b/src/loaders/svg/tvgSvgUtil.cpp index 1f1fe2a7..11c861f5 100644 --- a/src/loaders/svg/tvgSvgUtil.cpp +++ b/src/loaders/svg/tvgSvgUtil.cpp @@ -140,6 +140,8 @@ float svgUtilStrtof(const char *nPtr, char **endPtr) } val += static_cast(decimalPart) / static_cast(pow10); a = iter; + //skip if there is a space after the dot. + if (isspace(*a)) goto success; } //Optional: exponent