]> git.donarmstrong.com Git - samtools.git/commitdiff
* samtools-0.1.11-1 (r858)
authorHeng Li <lh3@live.co.uk>
Thu, 2 Dec 2010 16:24:41 +0000 (16:24 +0000)
committerHeng Li <lh3@live.co.uk>
Thu, 2 Dec 2010 16:24:41 +0000 (16:24 +0000)
 * fixed a bug in mpileup which causes segfaults
 * bcftools: do not segfault when BCF contains errors

bam_plcmd.c
bamtk.c
bcftools/bcf.c

index e3f73aaddd03a14343a82084ee060d9c41ba42d4..002297a1229678a256e9045f420b89d5f273b1ea 100644 (file)
@@ -563,9 +563,10 @@ static int mplp_func(void *data, bam1_t *b)
        mplp_aux_t *ma = (mplp_aux_t*)data;
        int ret, skip = 0;
        do {
-               int has_ref = (ma->ref && ma->ref_id == b->core.tid)? 1 : 0;
+               int has_ref;
                ret = ma->iter? bam_iter_read(ma->fp, ma->iter, b) : bam_read1(ma->fp, b);
                if (ret < 0) break;
+               has_ref = (ma->ref && ma->ref_id == b->core.tid)? 1 : 0;
                skip = 0;
                if (has_ref && (ma->flag&MPLP_REALN)) bam_prob_realn_core(b, ma->ref, 1);
                if (has_ref && ma->capQ_thres > 10) {
diff --git a/bamtk.c b/bamtk.c
index 4c2a4a282b7d351999f05c5e12d7d891acf93ba2..116c45f6ae69fef919ba162044ba00bce8d243db 100644 (file)
--- a/bamtk.c
+++ b/bamtk.c
@@ -9,7 +9,7 @@
 #endif
 
 #ifndef PACKAGE_VERSION
-#define PACKAGE_VERSION "0.1.11 (r851)"
+#define PACKAGE_VERSION "0.1.11-1 (r858)"
 #endif
 
 int bam_taf2baf(int argc, char *argv[]);
index fd5c0c9ae24971f15168f488452afe2077258dd0..6e45695cfb8c35a22dc4699728e445129293a699 100644 (file)
@@ -181,7 +181,7 @@ int bcf_read(bcf_t *bp, const bcf_hdr_t *h, bcf1_t *b)
        }
        bgzf_read(bp->fp, b->str, b->l_str);
        l = 12 + b->l_str;
-       bcf_sync(b);
+       if (bcf_sync(b) < 0) return -2;
        for (i = 0; i < b->n_gi; ++i) {
                bgzf_read(bp->fp, b->gi[i].data, b->gi[i].len * h->n_smpl);
                l += b->gi[i].len * h->n_smpl;