From b791ead7027d4fa6dc8d74f03045273ee01f13f2 Mon Sep 17 00:00:00 2001 From: Henning Stahlke Date: Sun, 14 Feb 2021 13:01:18 +0100 Subject: [PATCH] Fix SVG parser crash on unsupported element. --- Nasal/canvas/svg.nas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Nasal/canvas/svg.nas b/Nasal/canvas/svg.nas index fb733594f..536e20b53 100644 --- a/Nasal/canvas/svg.nas +++ b/Nasal/canvas/svg.nas @@ -422,7 +422,7 @@ var parsesvg = func(group, path, options = nil) { 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"]) defs_stack[-1][p] = evalCSSNum(attr[p]);