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
master
junsu choi 1 year ago committed by Hermet Park
parent 5ebebe4698
commit 92f77c5123
  1. 2
      src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c

@ -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;

Loading…
Cancel
Save