[vtkusers] bug in vtkShrinkFilter when numCells < 10

Steve Kirstukas sjk60 at iastate.edu
Wed Dec 19 12:02:43 EST 2001


In vtk v3.2, I found the following code in vtkShrinkFilter.cxx...

line 107: defined integer tenth as "tenth   = numCells / 10;"
line 116: divided cellId by tenth: "if (cellId % tenth == 0)"

Problem: When numCells < 10, tenth is set to zero, causing a divide by zero
error at run time.

Workaround: Add this line after line 107:
  if (tenth==0) tenth = 1;	// prevent divide by zero error when numCells < 10

-Steve




More information about the vtkusers mailing list