common Util: Skip if there is a space after the dot 93/289793/1
authorJunsuChoi <jsuya.choi@samsung.com>
Mon, 12 Dec 2022 06:08:06 +0000 (15:08 +0900)
committerMichal Szczecinski <mihashco89@gmail.com>
Tue, 14 Mar 2023 08:56:41 +0000 (09:56 +0100)
Some SVG parsers allow parsing of "0."
If there is a space after the dot, skip to the next step.

Change-Id: Ic1c455e2d5b8bf1e344af903f9721885c9fa1d37

src/loaders/svg/tvgSvgUtil.cpp

index 1f1fe2a..11c861f 100644 (file)
@@ -140,6 +140,8 @@ float svgUtilStrtof(const char *nPtr, char **endPtr)
         }
         val += static_cast<float>(decimalPart) / static_cast<float>(pow10);
         a = iter;
+        //skip if there is a space after the dot.
+        if (isspace(*a)) goto success;
     }
 
     //Optional: exponent