File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -413,8 +413,8 @@ BOOL CSoundFile::ReadMT2(LPCBYTE lpStream, DWORD dwMemLength)
413413#ifdef MT2DEBUG
414414 Log (" Loading instruments at offset 0x%08X\n " , dwMemPos);
415415#endif
416- memset (InstrMap, 0 , sizeof (InstrMap));
417416 m_nInstruments = (pfh->wInstruments < MAX_INSTRUMENTS ) ? pfh->wInstruments : MAX_INSTRUMENTS -1 ;
417+ for (UINT iIns=0 ; iIns< 255 ; iIns++) InstrMap[iIns]=NULL ;
418418 for (UINT iIns=1 ; iIns<=255 ; iIns++)
419419 {
420420 if (dwMemPos+36 > dwMemLength) return TRUE ;
@@ -556,8 +556,8 @@ BOOL CSoundFile::ReadMT2(LPCBYTE lpStream, DWORD dwMemLength)
556556#ifdef MT2DEBUG
557557 Log (" Loading samples at offset 0x%08X\n " , dwMemPos);
558558#endif
559- memset (SampleMap, 0 , sizeof (SampleMap));
560559 m_nSamples = (pfh->wSamples < MAX_SAMPLES ) ? pfh->wSamples : MAX_SAMPLES -1 ;
560+ for (UINT iSmp=0 ; iSmp< 256 ; iSmp++) SampleMap[iSmp]=NULL ;
561561 for (UINT iSmp=1 ; iSmp<=256 ; iSmp++)
562562 {
563563 if (dwMemPos > dwMemLength - 36 ) return TRUE ;
You can’t perform that action at this time.
0 commit comments