Skip to content

Commit c814d39

Browse files
committed
Reset variant types after updating alleles
Variant type calls produced by bcf_set_variant_types() may be stale after updating alleles via bcf_update_alleles() or bcf_update_alleles_str(), so set d.var_type to -1 to force a recalculation. Fixes an out of bounds access in bcftools consensus that occurred when it added a new allele to a record.
1 parent 2578c89 commit c814d39

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

vcf.c

+1
Original file line numberDiff line numberDiff line change
@@ -5495,6 +5495,7 @@ int bcf_has_filter(const bcf_hdr_t *hdr, bcf1_t *line, char *filter)
54955495
static inline int _bcf1_sync_alleles(const bcf_hdr_t *hdr, bcf1_t *line, int nals)
54965496
{
54975497
line->d.shared_dirty |= BCF1_DIRTY_ALS;
5498+
line->d.var_type = -1;
54985499

54995500
line->n_allele = nals;
55005501
hts_expand(char*, line->n_allele, line->d.m_allele, line->d.allele);

0 commit comments

Comments
 (0)