Index: VTK/Filtering/vtkConvexPointSet.cxx
===================================================================
RCS file: /cvsroot/ParaView3/ParaView3/VTK/Filtering/vtkConvexPointSet.cxx,v
retrieving revision 1.6
diff -u -r1.6 vtkConvexPointSet.cxx
--- VTK/Filtering/vtkConvexPointSet.cxx	4 Aug 2009 16:57:05 -0000	1.6
+++ VTK/Filtering/vtkConvexPointSet.cxx	26 Aug 2009 10:36:48 -0000
@@ -262,12 +262,12 @@
                                         double& minDist2, double *weights)
 {
   double pc[3], dist2;
-  int ignoreId, i, j, returnStatus=0, status;
+  int ignoreId, i, j, k, returnStatus=0, status;
   double tempWeights[4];
   double closest[3];
   vtkIdType ptId;
   int numTets = this->TetraIds->GetNumberOfIds() / 4;
-
+  int numPoints = this->GetNumberOfPoints();
 
   for (minDist2=VTK_DOUBLE_MAX, i=0; i<numTets; i++)
     {
@@ -282,16 +282,21 @@
                                            tempWeights);
     if ( status != -1 && dist2 < minDist2 )
       {
+      // initialize weights, since only the weights for the found tetrahedron are set below
+      for(k = 0; k < numPoints; ++k)
+        {
+         weights[k] = 0.0;
+        }
       returnStatus = status;
       minDist2 = dist2;
       subId = i;
       pcoords[0] = pc[0];
       pcoords[1] = pc[1];
       pcoords[2] = pc[2];
-      weights[0] = tempWeights[0];
-      weights[1] = tempWeights[1];
-      weights[2] = tempWeights[2];
-      weights[3] = tempWeights[3];
+      weights[this->TetraIds->GetId(4*i)] = tempWeights[0];
+      weights[this->TetraIds->GetId(4*i+1)] = tempWeights[1];
+      weights[this->TetraIds->GetId(4*i+2)] = tempWeights[2];
+      weights[this->TetraIds->GetId(4*i+3)] = tempWeights[3];
       }
     }
 
