r1298: fixed out-of-bound local alignment

I believe this would not lead to memory violation; it may occasionally include
a few base beyond the intended alignment start/end.
This commit is contained in:
Heng Li
2026-04-24 13:25:19 -04:00
parent 37a650f58c
commit 80d92c686f
2 changed files with 3 additions and 3 deletions

View File

@@ -67,7 +67,7 @@ void *ksw_ll_qinit(void *km, int size, int qlen, const uint8_t *query, int m, co
const int8_t *ma = mat + a * m;
for (i = 0; i < slen; ++i)
for (k = i; k < nlen; k += slen) // p iterations
*t++ = (k >= qlen? 0 : ma[query[k]]) + q->shift;
*t++ = (k >= qlen? -1 : ma[query[k]]) + q->shift;
}
} else {
int16_t *t = (int16_t*)q->qp;
@@ -76,7 +76,7 @@ void *ksw_ll_qinit(void *km, int size, int qlen, const uint8_t *query, int m, co
const int8_t *ma = mat + a * m;
for (i = 0; i < slen; ++i)
for (k = i; k < nlen; k += slen) // p iterations
*t++ = (k >= qlen? 0 : ma[query[k]]);
*t++ = (k >= qlen? -1 : ma[query[k]]);
}
}
return q;

View File

@@ -5,7 +5,7 @@
#include <stdio.h>
#include <sys/types.h>
#define MM_VERSION "2.30-r1290-dirty"
#define MM_VERSION "2.30-r1298-dirty"
#define MM_F_NO_DIAG (0x001LL) // no exact diagonal hit
#define MM_F_NO_DUAL (0x002LL) // skip pairs where query name is lexicographically larger than target name