Commit a78168dc authored by Mathieu Malaterre's avatar Mathieu Malaterre

BUG: FIX Bug #856 - Segfault in vtkVolumeProVP1000Mapper::UpdateVolume() if...

BUG: FIX Bug #856 - Segfault in vtkVolumeProVP1000Mapper::UpdateVolume() if data is not unsigned char or unsigned short. Thanks to Eric Branlund for patch.
parent ddfcf946
......@@ -35,7 +35,7 @@
#include <stdio.h>
#include <math.h>
vtkCxxRevisionMacro(vtkVolumeProVP1000Mapper, "1.26");
vtkCxxRevisionMacro(vtkVolumeProVP1000Mapper, "1.27");
//----------------------------------------------------------------------------
// Needed when we don't use the vtkStandardNewMacro.
......@@ -769,10 +769,13 @@ void vtkVolumeProVP1000Mapper::UpdateVolume( vtkRenderer * vtkNotUsed(ren), vtkV
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 @@ void vtkVolumeProVP1000Mapper::UpdateVolume( vtkRenderer * vtkNotUsed(ren), vtkV
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] &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment