From 885a4c1bc597fefd29e39634d7f342901b3d3958 Mon Sep 17 00:00:00 2001 From: Jean-Samuel Reynaud Date: Thu, 6 Jul 2017 10:40:52 +0200 Subject: [PATCH] Avoid an infinite loop in PNS Fixes: lp:1702485 * https://bugs.launchpad.net/kicad/+bug/1702485 --- pcbnew/router/pns_diff_pair.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pcbnew/router/pns_diff_pair.cpp b/pcbnew/router/pns_diff_pair.cpp index 0279e1bd9f..60889072fd 100644 --- a/pcbnew/router/pns_diff_pair.cpp +++ b/pcbnew/router/pns_diff_pair.cpp @@ -410,6 +410,10 @@ static VECTOR2I makeGapVector( VECTOR2I dir, int length ) { int l = length / 2; VECTOR2I rv; + + if( dir.EuclideanNorm() == 0 ) + return dir; + do { rv = dir.Resize( l );