|
From: <sv...@op...> - 2024-06-08 14:14:23
|
Author: sagamusix Date: Sat Jun 8 16:14:12 2024 New Revision: 20965 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20965 Log: [Fix] XM/MO3: Don't change channel count when finding ChnS extended song property. Modified: trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/soundlib/Load_it.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp Sat Jun 8 16:09:02 2024 (r20964) +++ trunk/OpenMPT/soundlib/Load_it.cpp Sat Jun 8 16:14:12 2024 (r20965) @@ -2503,10 +2503,11 @@ case MagicBE("ChnS"): // Channel settings for channels 65+ static_assert(MAX_BASECHANNELS >= 64); - if(size <= (MAX_BASECHANNELS - 64) * 2 && (size % 2u) == 0) + if(size <= (MAX_BASECHANNELS - 64) * 2 && (size % 2u) == 0 && (GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) { const CHANNELINDEX channelsInFile = mpt::saturate_cast<CHANNELINDEX>(64 + size / 2); - ChnSettings.resize(std::clamp(GetNumChannels(), channelsInFile, MAX_BASECHANNELS)); + if(!ignoreChannelCount) + ChnSettings.resize(std::clamp(GetNumChannels(), channelsInFile, MAX_BASECHANNELS)); const CHANNELINDEX loopLimit = std::min(channelsInFile, GetNumChannels()); for(CHANNELINDEX chn = 64; chn < loopLimit; chn++) { |