Skip to content

Commit 8df7756

Browse files
committed
Fix infinite loop issue caused by corrupt SVG file in parsePath #140
1 parent 9a05e19 commit 8df7756

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source/parser.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ Path Parser::parsePath(const std::string& string)
323323
currentPoint.x = c[3];
324324
currentPoint.y = c[4];
325325
} else if(command == 'Z' || command == 'z') {
326+
if(lastCommand == 'Z' || lastCommand == 'z')
327+
return path;
326328
path.close();
327329
currentPoint.x = startPoint.x;
328330
currentPoint.y = startPoint.y;

0 commit comments

Comments
 (0)