From e3b16faf4c7d035bd25a404373f46e16cc7e371e Mon Sep 17 00:00:00 2001 From: Martin Steinegger Date: Fri, 6 Dec 2024 15:09:50 +0700 Subject: [PATCH] Fix issue https://github.com/soedinglab/MMseqs2/issues/916 --- src/prefiltering/QueryMatcher.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/prefiltering/QueryMatcher.cpp b/src/prefiltering/QueryMatcher.cpp index 4666bcfe8..994464a39 100644 --- a/src/prefiltering/QueryMatcher.cpp +++ b/src/prefiltering/QueryMatcher.cpp @@ -323,11 +323,14 @@ size_t QueryMatcher::match(Sequence *seq, float *compositionBias) { outer: indexPointer[indexTo + 1] = databaseHits + numMatches; // fill the output - size_t hitCount = findDuplicates(indexPointer, foundDiagonals + overflowHitCount, + size_t hitCount = 0; + if(numMatches > 0){ + hitCount = findDuplicates(indexPointer, foundDiagonals + overflowHitCount, foundDiagonalsSize - overflowHitCount, indexStart, indexTo, (diagonalScoring == false)); - if (overflowHitCount != 0) { - // overflow occurred - hitCount = mergeElements(foundDiagonals, overflowHitCount + hitCount); + if (overflowHitCount != 0) { + // overflow occurred + hitCount = mergeElements(foundDiagonals, overflowHitCount + hitCount); + } } stats->doubleMatches = 0; if (diagonalScoring == false) {