samtools / htsjdk

A Java API for high-throughput sequencing data (HTS) formats.
http://samtools.github.io/htsjdk/
283 stars 242 forks source link

BCF version detection is too permissive #1323

Closed cmnbroad closed 5 years ago

cmnbroad commented 5 years ago

The BCF codec attempts to validate the version of a BCF file on read, but is overly permissive and accepts any minor version newer than the the current one. As a result, BCF 2.2 files are not rejected, even though the BCF implementation is BCF 2.1.

Until very recently, newer BCF files would be rejected because they contained IDX fields in the VCF header, but those are likely valid now as a result of https://github.com/samtools/htsjdk/pull/1248.

The version test should be changed to reject newer BCF versions as well as older ones.