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; char *end = nullptr;
str = _skipComma(str);
while (*str) { while (*str) {
// skip white space, comma float parsedValue = svgUtilStrtof(str, &end);
str = _skipComma(str); if (str == end) break;
(*dash).array.push(svgUtilStrtof(str, &end)); if (*end == '%') {
++end;
//TODO: multiply percentage value
}
(*dash).array.push(parsedValue);
str = _skipComma(end); str = _skipComma(end);
} }
//If dash array size is 1, it means that dash and gap size are the same. //If dash array size is 1, it means that dash and gap size are the same.