Skip to content

Commit 70664cc

Browse files
committed
Fix GMSMatcher crash when -1 value is assigned by getGridIndexLeft() in assignMatchPairs().
1 parent 9c0ae27 commit 70664cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/xfeatures2d/src/gms.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ int GMSMatcher::run(const int rotationType)
370370
// Mark inliers
371371
for (size_t i = 0; i < mNumberMatches; i++)
372372
{
373-
if (mCellPairs[mvMatchPairs[i].first] == mvMatchPairs[i].second)
373+
if (mvMatchPairs[i].first >= 0 && mCellPairs[mvMatchPairs[i].first] == mvMatchPairs[i].second)
374374
mvbInlierMask[i] = true;
375375
}
376376
}

0 commit comments

Comments
 (0)