vtkOpenGLImageActor::MakeDataSuitable() stuck in infinite while loop
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
affected Version: VTK 5.6 and later
What steps will reproduce the problem? difficult to reproduce outside of our large project. This is during an attempt to render a PNG on a different layer than a 3D model.
vtkOpenGLImageActor::MakeDataSuitable() should not get stuck in an infinite loop, regardless of the input.
vtkOpenGLImageActor::MakeDataSuitable() is stuck inside the following loop because xsize is zero: // if contiguous is it a pow of 2 if (contiguous) { xsize = ext[xdim2+1] - ext[xdim2] + 1; // xsize and ysize must be a power of 2 in OpenGL xs = static_cast(xsize); while (!(xs & 0x01)) { xs = xs >> 1; } if (xs == 1) { powOfTwo = 1; } }
I know we are doing something wrong in setting up the data for rendering (discovered later the extents in the vtkImageData instance were 0,-1,0,-1,0,0; the data came from an instance of vtkQImageToImageSource), when I debug and force it pass the while loop above, it later has a floating divide by zero exception. Although the extents were invalid, this is not obvious from being stuck in an infinite loop, which should be guarded against in the above code.