From: <sv...@op...> - 2025-01-03 10:47:55
|
Author: sagamusix Date: Fri Jan 3 11:47:43 2025 New Revision: 22739 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22739 Log: 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). ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/mptrack/View_pat.cpp Modified: branches/OpenMPT-1.31/mptrack/View_pat.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/View_pat.cpp Fri Jan 3 11:46:34 2025 (r22738) +++ branches/OpenMPT-1.31/mptrack/View_pat.cpp Fri Jan 3 11:47:43 2025 (r22739) @@ -279,7 +279,7 @@ 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 @@ 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 |