If graphic node is directly located in the <svg>(root) node,
it may cause underflow because stack.cnt is 0.
Change-Id: I04b8aac9354cb33a9e7b5d277e6681fbcecce975
loader->stack.push(node);
}
} else if ((method = _findGraphicsFactory(tagName))) {
- parent = loader->stack.list[loader->stack.cnt - 1];
+ if (loader->stack.cnt > 0) parent = loader->stack.list[loader->stack.cnt - 1];
+ else parent = loader->doc;
node = method(loader, parent, attrs, attrsLength);
} else if ((gradientMethod = _findGradientFactory(tagName))) {
SvgStyleGradient* gradient;