Fix SVG parser crash on unsupported <defs> element.
This commit is contained in:
parent
411ac4a0a8
commit
b791ead702
1 changed files with 1 additions and 1 deletions
|
@ -422,7 +422,7 @@ var parsesvg = func(group, path, options = nil)
|
||||||
{
|
{
|
||||||
append(defs_stack, {'type': name, 'id': attr['id']});
|
append(defs_stack, {'type': name, 'id': attr['id']});
|
||||||
}
|
}
|
||||||
else if( name == "rect" )
|
else if( ishash(defs_stack[-1]) and name == "rect" )
|
||||||
{
|
{
|
||||||
foreach(var p; ["x", "y", "width", "height"])
|
foreach(var p; ["x", "y", "width", "height"])
|
||||||
defs_stack[-1][p] = evalCSSNum(attr[p]);
|
defs_stack[-1][p] = evalCSSNum(attr[p]);
|
||||||
|
|
Loading…
Reference in a new issue