Skip to content

Commit

Permalink
Merged revision(s) 22738 from trunk/OpenMPT:
Browse files Browse the repository at this point in the history
[Fix] Pattern tab: Potential crash in continuous scroll mode if the current order cannot be retrieved (e.g. empty order list) (https://bugs.openmpt.org/view.php?id=1854).
........


git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.31@22739 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
sagamusix committed Jan 3, 2025
1 parent 5f32467 commit aa4151b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mptrack/View_pat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ ROWINDEX CViewPattern::SetCurrentRow(ROWINDEX row, WrapMode wrapMode, bool updat
PATTERNINDEX curPattern = m_nPattern;
ORDERINDEX curOrder = GetCurrentOrder();
// If current order and pattern are inconsistent, just jump to start of current pattern
if(curPattern != order[curOrder])
if(curOrder >= order.size() || curPattern != order[curOrder])
return SetCurrentRow(0);

do
Expand Down Expand Up @@ -314,7 +314,7 @@ ROWINDEX CViewPattern::SetCurrentRow(ROWINDEX row, WrapMode wrapMode, bool updat
PATTERNINDEX curPattern = m_nPattern;
ORDERINDEX curOrder = GetCurrentOrder();
// If current order and pattern are inconsistent, just jump to end of current pattern
if(curPattern != order[curOrder])
if(curOrder >= order.size() || curPattern != order[curOrder])
return SetCurrentRow(numRows - 1);

do
Expand Down

0 comments on commit aa4151b

Please sign in to comment.