Skip to content

Commit

Permalink
Fix infinite loop issue caused by corrupt SVG file in parsePath #140
Browse files Browse the repository at this point in the history
  • Loading branch information
sammycage committed Oct 29, 2023
1 parent 9a05e19 commit 8df7756
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ Path Parser::parsePath(const std::string& string)
currentPoint.x = c[3];
currentPoint.y = c[4];
} else if(command == 'Z' || command == 'z') {
if(lastCommand == 'Z' || lastCommand == 'z')
return path;
path.close();
currentPoint.x = startPoint.x;
currentPoint.y = startPoint.y;
Expand Down

0 comments on commit 8df7756

Please sign in to comment.