This is an automated email from the git hooks/post-receive script. plessy pushed a commit to branch debian/unstable in repository samtools.
commit d062687c6fed2a74712a9ea426335781f351efbc Author: Charles Plessy <[email protected]> Date: Fri Aug 22 07:53:22 2014 +0900 Refreshed to for upstream version 1.0. --- debian/patches/fix_segfault_with_small_ref.patch | 96 ++++++++++++------------ 1 file changed, 47 insertions(+), 49 deletions(-) diff --git a/debian/patches/fix_segfault_with_small_ref.patch b/debian/patches/fix_segfault_with_small_ref.patch index 0f1f665..00f7f75 100644 --- a/debian/patches/fix_segfault_with_small_ref.patch +++ b/debian/patches/fix_segfault_with_small_ref.patch @@ -1,53 +1,51 @@ Description: Fix segfault if position is outside of the reference sequence length Origin: Don Armstrong <[email protected]> -Index: samtools/bam_plcmd.c -=================================================================== ---- samtools.orig/bam_plcmd.c -+++ samtools/bam_plcmd.c -@@ -96,6 +96,7 @@ - bam_iter_t iter; - bam_header_t *h; - int ref_id; -+ int ref_len; - char *ref; - const mplp_conf_t *conf; +--- a/bam_plcmd.c ++++ b/bam_plcmd.c +@@ -127,6 +127,7 @@ + hts_itr_t *iter; + bam_hdr_t *h; + int ref_id; ++ int ref_len; + char *ref; + const mplp_conf_t *conf; } mplp_aux_t; -@@ -139,6 +140,11 @@ - qual[i] = qual[i] > 31? qual[i] - 31 : 0; - } - has_ref = (ma->ref && ma->ref_id == b->core.tid)? 1 : 0; -+ if (has_ref && (ma->ref_len <= b->core.pos)) { // exclude reads outside of the reference sequence -+ fprintf(stderr,"[%s] Skipping because %d is outside of %d [ref:%d]\n",__func__,b->core.pos,ma->ref_len,ma->ref_id); -+ skip = 1; -+ continue; -+ } - skip = 0; - if (has_ref && (ma->conf->flag&MPLP_REALN)) bam_prob_realn_core(b, ma->ref, (ma->conf->flag & MPLP_REDO_BAQ)? 7 : 3); - if (has_ref && ma->conf->capQ_thres > 10) { -@@ -307,7 +313,11 @@ - if (tid0 >= 0 && conf->fai) { // region is set - ref = faidx_fetch_seq(conf->fai, h->target_name[tid0], 0, 0x7fffffff, &ref_len); - ref_tid = tid0; -- for (i = 0; i < n; ++i) data[i]->ref = ref, data[i]->ref_id = tid0; -+ for (i = 0; i < n; ++i) { -+ data[i]->ref = ref; -+ data[i]->ref_id = tid0; -+ data[i]->ref_len = ref_len; -+ } - } else ref_tid = -1, ref = 0; - iter = bam_mplp_init(n, mplp_func, (void**)data); - max_depth = conf->max_depth; -@@ -325,7 +335,11 @@ - if (tid != ref_tid) { - free(ref); ref = 0; - if (conf->fai) ref = faidx_fetch_seq(conf->fai, h->target_name[tid], 0, 0x7fffffff, &ref_len); -- for (i = 0; i < n; ++i) data[i]->ref = ref, data[i]->ref_id = tid; -+ for (i = 0; i < n; ++i) { -+ data[i]->ref = ref; -+ data[i]->ref_id = tid; -+ data[i]->ref_len = ref_len; -+ } - ref_tid = tid; - } - if (conf->flag & MPLP_GLF) { +@@ -172,6 +173,11 @@ + qual[i] = qual[i] > 31? qual[i] - 31 : 0; + } + has_ref = (ma->ref && ma->ref_id == b->core.tid)? 1 : 0; ++ if (has_ref && (ma->ref_len <= b->core.pos)) { // exclude reads outside of the reference sequence ++ fprintf(stderr,"[%s] Skipping because %d is outside of %d [ref:%d]\n",__func__,b->core.pos,ma->ref_len,ma->ref_id); ++ skip = 1; ++ continue; ++ } + skip = 0; + if (has_ref && (ma->conf->flag&MPLP_REALN)) bam_prob_realn_core(b, ma->ref, (ma->conf->flag & MPLP_REDO_BAQ)? 7 : 3); + if (has_ref && ma->conf->capQ_thres > 10) { +@@ -419,7 +425,11 @@ + if (tid0 >= 0 && conf->fai) { // region is set + ref = faidx_fetch_seq(conf->fai, h->target_name[tid0], 0, 0x7fffffff, &ref_len); + ref_tid = tid0; +- for (i = 0; i < n; ++i) data[i]->ref = ref, data[i]->ref_id = tid0; ++ for (i = 0; i < n; ++i) { ++ data[i]->ref = ref; ++ data[i]->ref_id = tid0; ++ data[i]->ref_len = ref_len; ++ } + } else ref_tid = -1, ref = 0; + + // begin pileup +@@ -442,7 +452,11 @@ + if (tid != ref_tid) { + free(ref); ref = 0; + if (conf->fai) ref = faidx_fetch_seq(conf->fai, h->target_name[tid], 0, 0x7fffffff, &ref_len); +- for (i = 0; i < n; ++i) data[i]->ref = ref, data[i]->ref_id = tid; ++ for (i = 0; i < n; ++i) { ++ data[i]->ref = ref; ++ data[i]->ref_id = tid; ++ data[i]->ref_len = ref_len; ++ } + ref_tid = tid; + } + if (conf->flag & MPLP_BCF) { -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/samtools.git _______________________________________________ debian-med-commit mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit
