Skip to content

Commit

Permalink
Merge pull request #3707 from rism-digital/develop-fix-rest
Browse files Browse the repository at this point in the history
Additional check for boundaries in Rest::GetRestOffsetFromOptions
  • Loading branch information
lpugin authored Jun 17, 2024
2 parents ab7a0b9 + 3e321c8 commit c508e2e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,9 @@ int Rest::GetRestOffsetFromOptions(
RestLayer layer, const std::pair<int, RestAccidental> &location, bool isTopLayer) const
{
int duration = this->GetActualDur();
if (duration > DURATION_128) duration = DURATION_128;
// Make sure we are in the boundaries of g_defaultRests
if (duration > DUR_128) duration = DUR_128;
if (duration < DUR_LG) duration = DUR_LG;
return g_defaultRests.at(layer)
.at(RL_sameLayer == layer ? location.second : RA_none)
.at(isTopLayer ? RLP_restOnTopLayer : RLP_restOnBottomLayer)
Expand Down

0 comments on commit c508e2e

Please sign in to comment.