evas_vg_load_svg: Add check that stroke-dasharray is "none"

Summary:
"none" is the default value of dasharray and can actually be used.
Currently using "none" causes a segfault. This patch prevents it.

Test Plan:
SVG image
```
<svg viewBox="0 0 30 10" xmlns="http://www.w3.org/2000/svg">
  <line x1="0" y1="3" x2="30" y2="3" stroke="black" stroke-dasharray="none" />
</svg>
```

Reviewers: Hermet, raster, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12317
This commit is contained in:
junsu choi 2022-01-12 11:33:43 +09:00 committed by Hermet Park
parent 5ebebe4698
commit 92f77c5123
1 changed files with 2 additions and 0 deletions

View File

@ -267,6 +267,8 @@ _PARSE_TAG(Efl_Gfx_Fill_Rule, fill_rule, fill_rule_tags, EFL_GFX_FILL_RULE_WINDI
static inline void
_parse_dash_array(const char *str, Efl_Gfx_Dash** dash, int *length)
{
if (strlen(str) >= 4 && !strncmp(str, "none", 4)) return;
// It is assumed that the length of the dasharray string is 255 or less.
double tmp[255];
char *end = NULL;