Skip to content

Commit 696f551

Browse files
committed
fix for oom in isoline plotting if datarange doesn't overlap with the level range
1 parent b590bbd commit 696f551

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/visualisers/IsoPlot.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,12 @@ void IsoPlot::isoline(MatrixHandler& data, BasicGraphicsObjectContainer& parent)
12031203

12041204
MagLog::debug() << "Min=" << min << ", Max=" << max << endl;
12051205

1206+
// If data range has no overlap with the level range, the levels loop below
1207+
// would produce a single artificial band [last_level, data_max] covering
1208+
// every grid point, causing O(N) polygon segment allocation for all N cells.
1209+
if (max <= (*levelSelection_).front() || min >= (*levelSelection_).back())
1210+
return;
1211+
12061212
if ((*levelSelection_).front() > min)
12071213
levels_.push_back(min);
12081214

0 commit comments

Comments
 (0)