mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix out of bounds access
Triggered by calculations when data is missing for some time steps
This commit is contained in:
parent
5f78d5e842
commit
d26c736042
@ -2723,9 +2723,12 @@ void RigCaseCellResultsData::computeOilVolumes()
|
||||
size_t resultIndex = activeCellInfo()->cellResultIndex( nativeResvCellIndex );
|
||||
if ( resultIndex != cvf::UNDEFINED_SIZE_T )
|
||||
{
|
||||
CVF_ASSERT( soilResults.at( resultIndex ) <= 1.01 );
|
||||
oilVolumeResults[resultIndex] =
|
||||
std::max( 0.0, soilResults.at( resultIndex ) * cellVolumeResults.at( resultIndex ) );
|
||||
if ( resultIndex < soilResults.size() && resultIndex < cellVolumeResults.size() )
|
||||
{
|
||||
CVF_ASSERT( soilResults.at( resultIndex ) <= 1.01 );
|
||||
oilVolumeResults[resultIndex] =
|
||||
std::max( 0.0, soilResults.at( resultIndex ) * cellVolumeResults.at( resultIndex ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user