summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-09-02 18:34:59 +0900
committerHermet Park <chuneon.park@samsung.com>2020-09-02 18:34:59 +0900
commit40b6e44947740133df20d97ca3ed65268037af20 (patch)
tree39c2a83603b0b96c65b89994a4db2746c2051326
parentaf8bf56c98f2d405a588c5e9561ab05bfa832ef0 (diff)
SvgLoader: Defs type nodes are not saved in loader's node list.
Summary: If there is an empty (unused) <defs /> inside the svg file, this can cause problems. <defs> node is managed separately in loader->def. So it doesn't have to be added to loader's list. Test Plan: N/A Reviewers: Hermet, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers, kimcinoo, herb Tags: #efl Differential Revision: https://phab.enlightenment.org/D12127
-rw-r--r--src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
index cefdc3304f..38d6d50513 100644
--- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
+++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
@@ -2160,17 +2160,23 @@ _evas_svg_loader_xml_open_parser(Evas_SVG_Loader *loader,
2160 parent = eina_array_data_get(loader->stack, eina_array_count(loader->stack) - 1); 2160 parent = eina_array_data_get(loader->stack, eina_array_count(loader->stack) - 1);
2161 node = method(loader, parent, attrs, attrs_length); 2161 node = method(loader, parent, attrs, attrs_length);
2162 } 2162 }
2163 eina_array_push(loader->stack, node);
2164 2163
2165 if (node->type == SVG_NODE_DEFS) 2164 if (node->type == SVG_NODE_DEFS)
2166 { 2165 {
2167 loader->doc->node.doc.defs = node; 2166 loader->doc->node.doc.defs = node;
2168 loader->def = node; 2167 loader->def = node;
2169 } 2168 }
2169 else
2170 {
2171 eina_array_push(loader->stack, node);
2172 }
2170 } 2173 }
2171 else if ((method = _find_graphics_factory(tag_name))) 2174 else if ((method = _find_graphics_factory(tag_name)))
2172 { 2175 {
2173 parent = eina_array_data_get(loader->stack, eina_array_count(loader->stack) - 1); 2176 if (eina_array_count(loader->stack) > 0)
2177 parent = eina_array_data_get(loader->stack, eina_array_count(loader->stack) - 1);
2178 else
2179 parent = loader->doc;
2174 node = method(loader, parent, attrs, attrs_length); 2180 node = method(loader, parent, attrs, attrs_length);
2175 } 2181 }
2176 else if ((gradient_method = _find_gradient_factory(tag_name))) 2182 else if ((gradient_method = _find_gradient_factory(tag_name)))