Avoid an infinite loop in PNS

Fixes: lp:1702485
* https://bugs.launchpad.net/kicad/+bug/1702485
This commit is contained in:
Jean-Samuel Reynaud 2017-07-06 10:40:52 +02:00 committed by Tomasz Włostowski
parent 1724f902a1
commit 885a4c1bc5
1 changed files with 4 additions and 0 deletions

View File

@ -410,6 +410,10 @@ static VECTOR2I makeGapVector( VECTOR2I dir, int length )
{ {
int l = length / 2; int l = length / 2;
VECTOR2I rv; VECTOR2I rv;
if( dir.EuclideanNorm() == 0 )
return dir;
do do
{ {
rv = dir.Resize( l ); rv = dir.Resize( l );