From: <sv...@op...> - 2024-06-02 18:19:32
|
Author: sagamusix Date: Sun Jun 2 20:19:25 2024 New Revision: 20910 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20910 Log: [Fix] DSm: Only the first 48 samples were ever read. [Fix] DSm: It was possible that sample data was read into slots past the last sample slot; for these samples, sample loop lengths were not sanitized, possibly causing an out-of-bounds memory read during playback. Modified: trunk/OpenMPT/soundlib/Load_dsm.cpp Modified: trunk/OpenMPT/soundlib/Load_dsm.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_dsm.cpp Sun Jun 2 17:10:31 2024 (r20909) +++ trunk/OpenMPT/soundlib/Load_dsm.cpp Sun Jun 2 20:19:25 2024 (r20910) @@ -510,7 +510,7 @@ if(loadFlags & loadSampleData) { - for(SAMPLEINDEX smp = 1; smp <= m_nSamplePreAmp; smp++) + for(SAMPLEINDEX smp = 1; smp <= m_nSamples; smp++) { SampleIO(Samples[smp].uFlags[CHN_16BIT] ? SampleIO::_16bit : SampleIO::_8bit, SampleIO::mono, |