Fix vcfmerge format field handling for Number=G, INT8 PL, and dst buffer#2520
Open
sirus20x6 wants to merge 1 commit intosamtools:developfrom
Open
Fix vcfmerge format field handling for Number=G, INT8 PL, and dst buffer#2520sirus20x6 wants to merge 1 commit intosamtools:developfrom
sirus20x6 wants to merge 1 commit intosamtools:developfrom
Conversation
1. merge_localized_numberG_format_field: BCF_BT_INT32 case incorrectly used le_to_i16 instead of le_to_i32, causing wrong byte conversion for 32-bit integer FORMAT fields. 2. init_local_alleles: INT8 PL case lacked bounds checking on val before indexing into pl2prob[], risking out-of-bounds access. Added the same clamping guard (val>=0 && val<PL2PROB_MAX) already present in the INT16 and INT32 cases. 3. update_local_alleles: vector_end padding loop wrote to src[j] instead of dst[j], leaving the destination buffer with uninitialized trailing entries.
4a205b5 to
0580579
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
le_to_i16tole_to_i32inBCF_BT_INT32case ofmerge_localized_numberG_format_field— was reading only 2 of 4 bytespl2prob[], matching existing INT16/INT32 checkssrc[j] = bcf_int32_vector_endtodst[j]inupdate_local_alleles— was writing to source buffer instead of destinationTest plan