Fix issue #18014: avoid overflow
Avoid overflow when reading > 2,147,483,647 points in legacy VTK
format. The issue is caused while calculating the number of points
by multiplying three int
s, representing the extents. The result is
correctly stored in a variable of type vtkIdType
. If the extents are
large enough, such that the total number of points exceeds
2,147,483,647 an overflow occures and the following test fails:
if (npts != numPts)
...
vtkErrorMacro(<< "Number of points don't match data values!");
The patch addresses the bug by casting int
s to vtkIdType
before
multiplication.