From aa4151b507a3f9ed9cb7e6db1f9bc7f4cad961ba Mon Sep 17 00:00:00 2001 From: Johannes Schultz Date: Fri, 3 Jan 2025 10:47:43 +0000 Subject: [PATCH] Merged revision(s) 22738 from trunk/OpenMPT: [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 --- mptrack/View_pat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mptrack/View_pat.cpp b/mptrack/View_pat.cpp index 55c42471e85..f4c70ce7ac8 100644 --- a/mptrack/View_pat.cpp +++ b/mptrack/View_pat.cpp @@ -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 @@ -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