mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
svg_loader: fixing cyclic cloning of nodes
The reference node doesn't have to be placed inside the defs block, so when refering to it, it is necessary to search the entire node tree. In case of invalid svg file this can lead to circular references. Added prevention against such a sutuation.
This commit is contained in:
parent
9212c0d158
commit
04d3bb0ec0
1 changed files with 1 additions and 1 deletions
|
@ -1933,7 +1933,7 @@ static void _copyAttr(SvgNode* to, const SvgNode* from)
|
|||
static void _cloneNode(SvgNode* from, SvgNode* parent)
|
||||
{
|
||||
SvgNode* newNode;
|
||||
if (!from || !parent) return;
|
||||
if (!from || !parent || from == parent) return;
|
||||
|
||||
newNode = _createNode(parent, from->type);
|
||||
if (!newNode) return;
|
||||
|
|
Loading…
Add table
Reference in a new issue