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:
JunsuChoi 2023-12-20 16:18:18 +09:00 committed by GitHub
parent 1544ce2ba2
commit 6d9d051acf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;