From a64d60a4d39fa4d87c4d16c9ed995ab18cedab83 Mon Sep 17 00:00:00 2001 From: Joey Lee Date: Tue, 13 Aug 2024 15:11:51 +0900 Subject: [PATCH] fix: safe check --- src/prefiltering/UngappedAlignment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prefiltering/UngappedAlignment.cpp b/src/prefiltering/UngappedAlignment.cpp index 12af33c9..1aec6b26 100644 --- a/src/prefiltering/UngappedAlignment.cpp +++ b/src/prefiltering/UngappedAlignment.cpp @@ -276,7 +276,7 @@ void UngappedAlignment::scoreDiagonalAndUpdateHits(const char * queryProfile, unsigned int minSeqLen = std::min(targetMaxLen - minDistToDiagonal, queryLen); for(size_t i = 0; i < DIAGONALBINSIZE; i++) { tmpSeqs[i] = seqs[i].seq + minDistToDiagonal; - seqLength[i] = (seqs[i].seqLen == 0) ? 0 : std::min(seqs[i].seqLen - minDistToDiagonal, minSeqLen); + seqLength[i] = (seqs[i].seqLen > minDistToDiagonal) ? std::min(seqs[i].seqLen - minDistToDiagonal, minSeqLen) : 0; } unrolledDiagonalScoring(queryProfile, seqLength, tmpSeqs, score_arr);