summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/svgtiny.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/svgtiny.c b/src/svgtiny.c
index e42077a..bd9aeaa 100644
--- a/src/svgtiny.c
+++ b/src/svgtiny.c
@@ -188,6 +188,12 @@ svgtiny_code svgtiny_parse(struct svgtiny_diagram *diagram,
dom_node_unref(document);
return svgtiny_LIBDOM_ERROR;
}
+ if (svg == NULL) {
+ /* no root svg element */
+ dom_node_unref(document);
+ return svgtiny_SVG_ERROR;
+ }
+
exc = dom_node_get_node_name(svg, &svg_name);
if (exc != DOM_NO_ERR) {
dom_node_unref(svg);