mirror of
https://github.com/thorvg/thorvg.git
synced 2025-07-23 06:38:43 +00:00
loader/svg: Do not draw shapes with invalid path information
If appendPath() returns InvalidArguments(not Success) ,do not create a tvg::Shape.
This commit is contained in:
parent
1544ce2ba2
commit
6d9d051acf
1 changed files with 4 additions and 1 deletions
|
@ -399,7 +399,10 @@ static bool _recognizeShape(SvgNode* node, Shape* shape)
|
|||
Array<PathCommand> cmds;
|
||||
Array<Point> pts;
|
||||
if (svgPathToTvgPath(node->node.path.path, cmds, pts)) {
|
||||
shape->appendPath(cmds.data, cmds.count, pts.data, pts.count);
|
||||
if (shape->appendPath(cmds.data, cmds.count, pts.data, pts.count) != Result::Success) {
|
||||
TVGERR("SVG", "Invalid path information.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue