Index: vtkPolyLine.cxx
===================================================================
RCS file: /cvsroot/VTK/VTK/Filtering/vtkPolyLine.cxx,v
retrieving revision 1.1
diff -u -r1.1 vtkPolyLine.cxx
--- vtkPolyLine.cxx	17 Aug 2004 18:34:12 -0000	1.1
+++ vtkPolyLine.cxx	15 May 2006 15:29:55 -0000
@@ -282,6 +282,11 @@
 
   return_status = 0;
   weights[0] = 0.0;
+
+  double bestWeights[2];
+  bestWeights[0] = 0.0;
+  bestWeights[1] = 0.0;
+
   for (minDist2=VTK_DOUBLE_MAX,i=0; i<this->Points->GetNumberOfPoints()-1; i++)
     {
     this->Line->Points->SetPoint(0,this->Points->GetPoint(i));
@@ -300,15 +305,18 @@
       minDist2 = dist2;
       subId = i;
       pcoords[0] = pc[0];
-      weights[i] = lineWeights[0];
-      weights[i+1] = lineWeights[1];
-      }
-    else
-      {
+      bestWeights[0] = lineWeights[0];
+      bestWeights[1] = lineWeights[1];
       weights[i+1] = 0.0;
       }
     }
 
+  if (minDist2 < VTK_DOUBLE_MAX)
+    {
+    weights[subId] = bestWeights[0];
+    weights[subId+1] = bestWeights[1];
+    }
+
   return return_status;
 }
 
