Skip to content

Commit

Permalink
Merge pull request #872 from leejoey0921/fix/prefilter_segfault
Browse files Browse the repository at this point in the history
fix: prefilter segfault
  • Loading branch information
martin-steinegger authored Aug 16, 2024
2 parents ffb0561 + a64d60a commit 8ef39f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/prefiltering/UngappedAlignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ void UngappedAlignment::scoreDiagonalAndUpdateHits(const char * queryProfile,
// hack to avoid too long sequences
// this sequences will be processed by computeLongScore later
seqs[seqIdx].seq = (unsigned char *) tmp.first;
seqs[seqIdx].seqLen = 1;
seqs[seqIdx].seqLen = 0;
seqs[seqIdx].id = seqIdx;
}else{
seqs[seqIdx].seq = (unsigned char *) tmp.first;
Expand All @@ -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] = std::min(seqs[i].seqLen - minDistToDiagonal, minSeqLen);
seqLength[i] = (seqs[i].seqLen > minDistToDiagonal) ? std::min(seqs[i].seqLen - minDistToDiagonal, minSeqLen) : 0;
}
unrolledDiagonalScoring<Sequence::PROFILE_AA_SIZE + 1>(queryProfile, seqLength,
tmpSeqs, score_arr);
Expand All @@ -286,7 +286,7 @@ void UngappedAlignment::scoreDiagonalAndUpdateHits(const char * queryProfile,
for(size_t hitIdx = 0; hitIdx < hitSize; hitIdx++){
hits[seqs[hitIdx].id]->count = static_cast<unsigned char>(std::min(static_cast<unsigned int>(255),
score_arr[hitIdx]));
if(seqs[hitIdx].seqLen == 1){
if(seqs[hitIdx].seqLen == 0){
std::pair<const unsigned char *, const unsigned int> dbSeq = sequenceLookup->getSequence(hits[hitIdx]->id);
if(dbSeq.second >= 32768){
int max = computeLongScore(queryProfile, queryLen, dbSeq, diagonal);
Expand Down

0 comments on commit 8ef39f4

Please sign in to comment.