Commit 1adf7b75 authored by Sebastien Jourdain's avatar Sebastien Jourdain
Browse files

Fix invalid memory access when no slice where available for a given axis.

This error was showing up on Windows/Debug dashboard.

Change-Id: I2c07ed359c377827ba011e12b02a3ca224adc185
parent e83f939e
......@@ -239,9 +239,33 @@ void pqMultiSliceView::updateViewModelCallBack(vtkObject*,unsigned long, void*)
bool visibility[255];
memset(visibility, true, 255);
this->AxisX->updateSlices(&xSlices[0], visibility, static_cast<int>(xSlices.size()));
this->AxisY->updateSlices(&ySlices[0], visibility, static_cast<int>(ySlices.size()));
this->AxisZ->updateSlices(&zSlices[0], visibility, static_cast<int>(zSlices.size()));
double emptyDouble = 0;
if( xSlices.size() > 0 )
{
this->AxisX->updateSlices(&xSlices[0], visibility, static_cast<int>(xSlices.size()));
}
else // Reset slices
{
this->AxisX->updateSlices(&emptyDouble, visibility, 0);
}
if( ySlices.size() > 0 )
{
this->AxisY->updateSlices(&ySlices[0], visibility, static_cast<int>(ySlices.size()));
}
else // Reset slices
{
this->AxisY->updateSlices(&emptyDouble, visibility, 0);
}
if( zSlices.size() > 0 )
{
this->AxisZ->updateSlices(&zSlices[0], visibility, static_cast<int>(zSlices.size()));
}
else // Reset slices
{
this->AxisZ->updateSlices(&emptyDouble, visibility, 0);
}
this->render();
}
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