X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=misc%2Fbamcheck.c;h=03cf3b233fec3b7d976dc07ac82fad94fd47a70c;hb=6c564bfee2d3d5ad47691f0c50898b9511010db6;hp=7b5fd029469aa2373d950a43fb92d68218d82f8c;hpb=248e7fec261fb1e5ac4281fb6064989f52c206c8;p=samtools.git diff --git a/misc/bamcheck.c b/misc/bamcheck.c index 7b5fd02..03cf3b2 100644 --- a/misc/bamcheck.c +++ b/misc/bamcheck.c @@ -12,7 +12,7 @@ considered, even small overlap is good enough to include the read in the stats. */ -#define BAMCHECK_VERSION "2012-03-22" +#define BAMCHECK_VERSION "2012-03-29" #define _ISOC99_SOURCE #define _GNU_SOURCE @@ -1240,7 +1240,7 @@ int main(int argc, char *argv[]) { if ( stats->regions ) { - if ( bam_line->core.tid >= stats->nregions ) continue; + if ( bam_line->core.tid >= stats->nregions || bam_line->core.tid<0 ) continue; if ( !stats->is_sorted ) error("The BAM must be sorted in order for -t to work.\n"); regions_t *reg = &stats->regions[bam_line->core.tid];