Skip to content
Snippets Groups Projects
Commit 8ecac6d9 authored by Julien Michel's avatar Julien Michel
Browse files

Correction dépassement de tableau détecté avec visual

parent eaa72cc3
No related branches found
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@ namespace otb
{
m_MinSpectralValue = 0;
m_MaxSpectralValue = 0;
m_FilterFunctionValues.empty();
m_FilterFunctionValues.clear();
}
/**PrintSelf method */
......
......@@ -177,10 +177,18 @@ SIXSTraits::ComputeWavelenghtSpectralBandValuesFor6S(
{
// Search the User interval that surround the StepOfWavelenghtSpectralBandValues current value.
while(j*L_userStep <= value)
// removed the <= here, might be wrong
while(j*L_userStep < value)
{
j++;
}
// Check if we are not out of bound
if(j>=FilterFunctionValues.size())
{
itkGenericExceptionMacro(<<"Index "<<j<<" out of bound for FilterFunctionValues vector (size: "<<FilterFunctionValues.size()<<").");
}
double valueTemp;
valueTemp = static_cast<double>(FilterFunctionValues[j-1])
+ ((static_cast<double>(FilterFunctionValues[j])-static_cast<double>(FilterFunctionValues[j-1]))*invStep)
......
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