[vtkusers] bug in vtkAppendFilter + fix

alext at win.tue.nl alext at win.tue.nl
Fri Jun 9 06:34:32 EDT 2000


  Hi all,

  There's a bug in vtkAppendFilter's implementation. I guess the bug is
there for all releases 2.3 - 3.1.
  The problem appears when connecting several inputs to vtkAppendFilter
  (by calling AddInput()), then deleting one of them (by RemoveInput())
and then calling Update(). The program crashes in Execute(), and with good
reasons...

  The problem is caused by the lines 333, 334 in vtkAppendFilter.cxx
(line numbers refer to the vtk3.1 distribution), that read as:

   ptOffset+=numPts;
   cellOffset+=numCells;

  These lines should be contained INSIDE the above for loop, and not OUTSIDE
it - since they are to be executed ONLY for non-NULL inputs ! To fix the
bug, simply move the two lines at the end and inside the for loop ending on
the line above. Actually this is the way it is done in vtkAppendPolyData's
implementation, which is correct.

   Alex

------------------------------------------------------------------
  Alexandru C. Telea   	      | Technische Universiteit Eindhoven
			      |	
  E-mail   : alext at win.tue.nl | Dept. of Mathematics and 
  			      | Computing Science
  Office   :  HG 8.30         | Postbus 513
  Tel.     : +31 40 247 4328  | 5600 MB Eindhoven
  Secretary: +31 40 247 4416  | The Netherlands			      
  Fax	   : +31 40 244 2489  |
  URL      : http://www.win.tue.nl/math/an/alext
-------------------------------------------------------------------


  




More information about the vtkusers mailing list