Avoid negative indicies in minPvFillNtg_

This commit is contained in:
Tor Harald Sandve
2017-05-23 15:48:35 +02:00
parent 64feefaf05
commit a5858393c6

View File

@@ -429,6 +429,10 @@ private:
// use the original ntg values if the cell above has porv > minPVvalue.
int cartesianCellIdxAbove = cartesianCellIdx - nxny;
if (cartesianCellIdxAbove < 0)
continue;
if (porv[cartesianCellIdxAbove] > eclGrid.getMinpvValue() ){
averageNtg[cartesianCellIdx] = ntg[cartesianCellIdx];
continue;