From: <sv...@op...> - 2024-11-19 17:58:01
|
Author: sagamusix Date: Tue Nov 19 18:57:55 2024 New Revision: 22241 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22241 Log: [Fix] Also limit sample pre-amp to 2000 for formats where we retrieve it through other means than OpenMPT song extensions (e.g. MO3). [Fix] Sanitize sample length and loop points for missing external samples as well. Otherwise invalid values might be used during seeking. Modified: trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/soundlib/Load_it.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp Tue Nov 19 18:55:27 2024 (r22240) +++ trunk/OpenMPT/soundlib/Load_it.cpp Tue Nov 19 18:57:55 2024 (r22241) @@ -2664,11 +2664,6 @@ m_nMixLevels = MixLevels::Original; //m_dwCreatedWithVersion //m_dwLastSavedWithVersion - LimitMax(m_nSamplePreAmp, 2000u); - LimitMax(m_nVSTiVolume, 2000u); - LimitMax(m_nDefaultGlobalVolume, MAX_GLOBAL_VOLUME); - LimitMax(m_nDefaultRowsPerBeat, MAX_ROWS_PER_BEAT); - LimitMax(m_nDefaultRowsPerMeasure, MAX_ROWS_PER_BEAT); return true; } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp Tue Nov 19 18:55:27 2024 (r22240) +++ trunk/OpenMPT/soundlib/Sndfile.cpp Tue Nov 19 18:57:55 2024 (r22241) @@ -610,6 +610,8 @@ for(SAMPLEINDEX nSmp = 1; nSmp <= m_nSamples; nSmp++) { ModSample &sample = Samples[nSmp]; + LimitMax(sample.nLength, MAX_SAMPLE_LENGTH); + sample.SanitizeLoops(); #ifdef MPT_EXTERNAL_SAMPLES if(SampleHasPath(nSmp) && (loadFlags & loadSampleData)) @@ -671,6 +673,8 @@ LimitMax(m_nDefaultRowsPerBeat, MAX_ROWS_PER_BEAT); LimitMax(m_nDefaultRowsPerMeasure, MAX_ROWS_PER_BEAT); LimitMax(m_nDefaultGlobalVolume, MAX_GLOBAL_VOLUME); + LimitMax(m_nSamplePreAmp, 2000); + LimitMax(m_nVSTiVolume, 2000); if(!m_tempoSwing.empty()) m_tempoSwing.resize(m_nDefaultRowsPerBeat); |