Skip to content

Commit

Permalink
0.7.9a-r786: fixed a segfault in a rare case
Browse files Browse the repository at this point in the history
More likely to happen given a circular genome
  • Loading branch information
lh3 committed May 19, 2014
1 parent 031d3d8 commit 3efc331
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bwamem_pair.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int mem_matesw(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, co
if (skip[0] + skip[1] + skip[2] + skip[3] == 4) return 0; // consistent pair exist; no need to perform SW
for (r = 0; r < 4; ++r) {
int is_rev, is_larger;
uint8_t *seq, *rev = 0, *ref;
uint8_t *seq, *rev = 0, *ref = 0;
int64_t rb, re;
if (skip[r]) continue;
is_rev = (r>>1 != (r&1)); // whether to reverse complement the mate
Expand All @@ -142,8 +142,8 @@ int mem_matesw(const mem_opt_t *opt, const bntseq_t *bns, const uint8_t *pac, co
}
if (rb < 0) rb = 0;
if (re > l_pac<<1) re = l_pac<<1;
ref = bns_fetch_seq(bns, pac, &rb, (rb+re)>>1, &re, &rid);
if (a->rid == rid) { // no funny things happening
if (rb < re) ref = bns_fetch_seq(bns, pac, &rb, (rb+re)>>1, &re, &rid);
if (a->rid == rid && re - rb >= opt->min_seed_len) { // no funny things happening
kswr_t aln;
mem_alnreg_t b;
int tmp, xtra = KSW_XSUBO | KSW_XSTART | (l_ms * opt->a < 250? KSW_XBYTE : 0) | (opt->min_seed_len * opt->a);
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "utils.h"

#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.7.9-r783"
#define PACKAGE_VERSION "0.7.9a-r786"
#endif

int bwa_fa2pac(int argc, char *argv[]);
Expand Down

0 comments on commit 3efc331

Please sign in to comment.