samtools / htslib

C library for high-throughput sequencing data formats
Other
804 stars 446 forks source link

Ensure number of modifications is always set in bam_parse_basemod2() #1647

Closed daviesrob closed 1 year ago

daviesrob commented 1 year ago

Set state->nmods to 0 at the start, in case the function returns early. This ensures calls to bam_mods_at_next_pos() won't try to replay the mods from an earlier line.

jkbonfield commented 1 year ago

Thanks. Kind of suprising we haven't noticed this before.