X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bam_plcmd.c;h=ba787a98bd78726503f48af1fd16582d89a357dd;hb=ec5db8370dc97a853d6fada24ec518756a35e070;hp=e2601ecc3c26b41051d0148a9cf9696036d297fb;hpb=a7dfcd368cda94d5847d3f2b42d4288399d77835;p=samtools.git diff --git a/bam_plcmd.c b/bam_plcmd.c index e2601ec..ba787a9 100644 --- a/bam_plcmd.c +++ b/bam_plcmd.c @@ -121,9 +121,11 @@ static int glt3_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *pu, g3->offset = pos - d->last_pos; d->last_pos = pos; glf3_write1(d->fp_glf, g3); - if (proposed_indels) - r = bam_maqindel(n, pos, d->ido, pu, d->ref, proposed_indels[0], proposed_indels+1); - else r = bam_maqindel(n, pos, d->ido, pu, d->ref, 0, 0); + if (pos < d->len) { + if (proposed_indels) + r = bam_maqindel(n, pos, d->ido, pu, d->ref, proposed_indels[0], proposed_indels+1); + else r = bam_maqindel(n, pos, d->ido, pu, d->ref, 0, 0); + } if (r) { // then write indel line int het = 3 * n, min; min = het;