|
From: <sag...@us...> - 2010-06-15 16:36:43
|
Revision: 623
http://modplug.svn.sourceforge.net/modplug/?rev=623&view=rev
Author: saga-games
Date: 2010-06-15 16:36:36 +0000 (Tue, 15 Jun 2010)
Log Message:
-----------
[Fix] Note Properties: Fixed a null pointer related crash when accessing the note properties of malicious and not-so-malicious modules (f.e. jt_pools.xm) which have more samples than MAX_INSTRUMENTS (256).
Modified Paths:
--------------
trunk/OpenMPT/mptrack/dlg_misc.cpp
Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp
===================================================================
--- trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-06-13 17:54:27 UTC (rev 622)
+++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2010-06-15 16:36:36 UTC (rev 623)
@@ -1391,13 +1391,13 @@
{
// instrument / sample
combo->SetItemData(combo->AddString("No Instrument"), 0);
- UINT max = max(pSndFile->m_nInstruments, pSndFile->m_nSamples); // instrument / sample mode
- for (UINT i = 1; i <= max; i++)
+ const UINT nmax = pSndFile->GetNumInstruments() ? pSndFile->GetNumInstruments() : pSndFile->GetNumSamples();
+ for (UINT i = 1; i <= nmax; i++)
{
wsprintf(s, "%02d: ", i);
int k = strlen(s);
// instrument / sample
- if (pSndFile->m_nInstruments)
+ if (pSndFile->GetNumInstruments())
{
if (pSndFile->Instruments[i])
memcpy(s+k, pSndFile->Instruments[i]->name, 32);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|