RicPerforationCellFilterEvaluator: Guard against out-of-range global cell index

This commit is contained in:
Magne Sjaastad committed 2026-05-21 10:12:49 +02:00
1 parent 294ab9f277
commit dad431edac
1 file changed
+6
@@ -57,6 +57,12 @@ bool RicPerforationCellFilterEvaluator::includesGlobalCell( size_t globalCellInd
const RigMainGrid* mainGrid = m_eclipseCase->eclipseCaseData()->mainGrid();
if ( globalCellIndex >= mainGrid->totalCellCount() )
{
++m_rejectedCellCount;
return false;
}
size_t localCellIndex = 0;
const RigGridBase* localGrid = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( globalCellIndex, &localCellIndex );
if ( !localGrid )