From: <sag...@us...> - 2011-05-17 18:33:43
|
Revision: 876 http://modplug.svn.sourceforge.net/modplug/?rev=876&view=rev Author: saga-games Date: 2011-05-17 18:33:34 +0000 (Tue, 17 May 2011) Log Message: ----------- [Fix] Welcome to episode 2938 of "this should not have happened afterall". When playing a pattern that is not in the sequence that has more rows than the last played order item, SetRowVisited crashed. I have no idea why it even got there. [Ref] Made pattern rename code look less stupid. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-05-16 14:23:08 UTC (rev 875) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2011-05-17 18:33:34 UTC (rev 876) @@ -1067,13 +1067,13 @@ { if ((m_pSndFile) && (m_pModDoc) && (!IsLocked())) { - CHAR s[256], sold[128] = ""; - PATTERNINDEX nPat = (PATTERNINDEX)SendViewMessage(VIEWMSG_GETCURRENTPATTERN); + const PATTERNINDEX nPat = (PATTERNINDEX)SendViewMessage(VIEWMSG_GETCURRENTPATTERN); - m_EditPatName.GetWindowText(s, MAX_PATTERNNAME); - s[MAX_PATTERNNAME - 1] = 0; - m_pSndFile->Patterns[nPat].GetName(sold, CountOf(sold)); - if (strcmp(s, sold)) + CHAR s[MAX_PATTERNNAME]; + m_EditPatName.GetWindowText(s, CountOf(s)); + SetNullTerminator(s); + + if (m_pSndFile->Patterns[nPat].GetName().Compare(s)) { if(m_pSndFile->Patterns[nPat].SetName(s)) { Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-05-16 14:23:08 UTC (rev 875) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2011-05-17 18:33:34 UTC (rev 876) @@ -3993,7 +3993,7 @@ { const MODCHANNEL *pChn = &Chn[nChn]; // Unlike channel settings, pModInstrument is copied from the original chan to the NNA chan, - // so we don't nee to worry about finding the master chan. + // so we don't need to worry about finding the master chan. UINT nPlugin=0; if (pChn && pChn->pModInstrument) { @@ -4148,7 +4148,7 @@ //-------------------------------------------------------------------------------------------------------------------------- { const ORDERINDEX nMaxOrd = Order.GetLengthTailTrimmed(); - if(nOrd >= nMaxOrd || nRow > Patterns[Order[nOrd]].GetNumRows()) + if(nOrd >= nMaxOrd || nRow >= Patterns[Order[nOrd]].GetNumRows()) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |