Skip to content

Commit 67ffad6

Browse files
committed
Fixed a bug in new minMax() where a thread that doesn't visit a valid would run an invalid join() op
Signed-off-by: Nick Avramoussis <[email protected]>
1 parent 4888f00 commit 67ffad6

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

openvdb/openvdb/tools/Count.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,20 @@ struct MinMaxValuesOp
368368

369369
bool join(const MinMaxValuesOp& other)
370370
{
371-
if (math::cwiseLessThan(other.min, min))
372-
min = other.min;
371+
if (!other.seen_value) return true;
373372

374-
if (math::cwiseGreaterThan(other.max, max))
373+
if (!seen_value) {
374+
min = other.min;
375375
max = other.max;
376+
}
377+
else {
378+
if (math::cwiseLessThan(other.min, min))
379+
min = other.min;
380+
if (math::cwiseGreaterThan(other.max, max))
381+
max = other.max;
382+
}
376383

377-
seen_value |= other.seen_value;
378-
384+
seen_value = true;
379385
return true;
380386
}
381387

0 commit comments

Comments
 (0)