svg_loader: fix dead loop on none digit char in stroke-dasharray

This commit is contained in:
Michal Maciola 2021-07-02 15:57:12 +02:00 committed by JunsuChoi
parent a40d3f6fd7
commit 2f8c00580d

View file

@ -250,10 +250,15 @@ _parseDashArray(const char *str, SvgDash* dash)
char *end = nullptr;
str = _skipComma(str);
while (*str) {
// skip white space, comma
str = _skipComma(str);
(*dash).array.push(svgUtilStrtof(str, &end));
float parsedValue = svgUtilStrtof(str, &end);
if (str == end) break;
if (*end == '%') {
++end;
//TODO: multiply percentage value
}
(*dash).array.push(parsedValue);
str = _skipComma(end);
}
//If dash array size is 1, it means that dash and gap size are the same.