Skip to content

Commit

Permalink
Merge pull request #280 from bkille/fix-wflign-patch-underflow
Browse files Browse the repository at this point in the history
Fix uint64_t underflow
  • Loading branch information
ekg authored Oct 9, 2024
2 parents 73c1331 + 6d409e8 commit 7eb3c4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/common/wflign/src/wflign_patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,9 @@ std::vector<alignment_t> do_progressive_wfa_patch_alignment(
/// ....
// Calculate the sizes of unaligned regions using only the bounds
uint64_t left_query_size = bounds.query_start_offset;
uint64_t right_query_size = remaining_query_length - bounds.query_end_offset;
uint64_t right_query_size = remaining_query_length > bounds.query_end_offset ? remaining_query_length - bounds.query_end_offset : 0;
uint64_t left_target_size = bounds.target_start_offset;
uint64_t right_target_size = remaining_target_length - bounds.target_end_offset;
uint64_t right_target_size = remaining_target_length > bounds.target_end_offset ? remaining_target_length - bounds.target_end_offset : 0;

uint64_t max_left_size = std::max(left_query_size, left_target_size);
uint64_t max_right_size = std::max(right_query_size, right_target_size);
Expand Down

0 comments on commit 7eb3c4b

Please sign in to comment.