From: Heng Li <lh3@live.co.uk>
Date: Wed, 27 Oct 2010 23:58:54 +0000 (+0000)
Subject: fixed a silly bug in pileup
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3bedbd7fb801e7d0ffdedf2eb53dcce9ff08d31a;p=samtools.git

fixed a silly bug in pileup
---

diff --git a/bam_plcmd.c b/bam_plcmd.c
index 23602cc..dca8518 100644
--- a/bam_plcmd.c
+++ b/bam_plcmd.c
@@ -473,6 +473,7 @@ int bam_pileup(int argc, char *argv[])
 			bam_plp_set_mask(iter, d->mask);
 			while ((ret = samread(fp, b)) >= 0) {
 				int skip = 0;
+				if ((int)b->core.tid < 0) break;
 				// update d->ref if necessary
 				if (d->fai && (int)b->core.tid != d->tid) {
 					free(d->ref);