Skip to content
Snippets Groups Projects
Unverified Commit 69a6f596 authored by Jean-Christophe Fillion-Robin's avatar Jean-Christophe Fillion-Robin
Browse files

vtkImageToImageStencil: Fix integer overflow to support image > 2GB

parent 24172e2a
No related branches found
No related tags found
No related merge requests found
......@@ -144,9 +144,9 @@ int vtkImageToImageStencil::RequestData(
int r2 = extent[1];
// index into scalar array
int idS = ((extent[1] - extent[0] + 1)*
((extent[3] - extent[2] + 1)*(idZ - extent[4]) +
(idY - extent[2])));
vtkIdType idS = (static_cast<vtkIdType>(extent[1] - extent[0] + 1)*
(static_cast<vtkIdType>(extent[3] - extent[2] + 1)*static_cast<vtkIdType>(idZ - extent[4]) +
static_cast<vtkIdType>(idY - extent[2])));
for (int idX = extent[0]; idX <= extent[1]; idX++)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment