Fix out of bounds access

Triggered by calculations when data is missing for some time steps
This commit is contained in:
Magne Sjaastad 2020-04-03 13:15:20 +02:00 committed by Gaute Lindkvist
parent 5f78d5e842
commit d26c736042

View File

@ -2722,6 +2722,8 @@ void RigCaseCellResultsData::computeOilVolumes()
{
size_t resultIndex = activeCellInfo()->cellResultIndex( nativeResvCellIndex );
if ( resultIndex != cvf::UNDEFINED_SIZE_T )
{
if ( resultIndex < soilResults.size() && resultIndex < cellVolumeResults.size() )
{
CVF_ASSERT( soilResults.at( resultIndex ) <= 1.01 );
oilVolumeResults[resultIndex] =
@ -2729,6 +2731,7 @@ void RigCaseCellResultsData::computeOilVolumes()
}
}
}
}
}
//--------------------------------------------------------------------------------------------------