Skip to content

Commit dcf7d2e

Browse files
committed
Require nThreads to be a sane value
1 parent 354592d commit dcf7d2e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/ComponentLabeling.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,9 @@ myCompLabelerGroup::~myCompLabelerGroup()
454454

455455
void myCompLabelerGroup::set( int nThreads, Mat binIm )
456456
{
457+
if (nThreads <= 0) {
458+
nThreads = 1;
459+
}
457460
this->numThreads=nThreads;
458461
if(binIm.isContinuous()){
459462
this->img=binIm;

0 commit comments

Comments
 (0)