Segfault in vtkVolumeProVP1000Mapper::UpdateVolume() if data is not unsigned char or unsigned short
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
Passing data that is not unsigned short or unsigned char through vtkVolumeProVP1000Mapper causes a crash when UpdateVolume() is called. The following patch (generated with diff -Naur vtkVolumeProVP1000Mapper.cxx vtkVolumeProVP1000Mapper.cxx.new where the first file is version 1.26 from CVS) fixes the problem by avoiding dereferencing the Volume member if it is 0.
--- vtkVolumeProVP1000Mapper.cxx Mon Dec 29 13:36:29 2003 +++ vtkVolumeProVP1000Mapper.cxx.new Mon May 17 15:29:36 2004 @@ -769,10 +769,13 @@ correctionMatrixVLI[i][j] = correctionTransform->GetMatrix()->GetElement( i, j ); }
- status = this->Volume->SetCorrectionMatrix( correctionMatrixVLI );
- if ( status != kVLIOK )
- if ( this->Volume ) {
- vtkErrorMacro( << "Error setting the correction matrix: " << status );
-
status = this->Volume->SetCorrectionMatrix( correctionMatrixVLI );
-
if ( status != kVLIOK )
-
{
-
vtkErrorMacro( << "Error setting the correction matrix: " << status );
-
}
}
status = this->Context->GetCamera().SetModelMatrix( modelMatrixVLI ); @@ -786,7 +789,8 @@ modelTransform->Delete();
// Update the subvolume if it is reasonable
- if ( this->SubVolume[0] >= 0 &&
- if ( this->Volume &&
-
this->SubVolume[0] >= 0 && this->SubVolume[2] >= 0 && this->SubVolume[4] >= 0 && this->SubVolume[0] < dataSize[0] &&