From: <sag...@us...> - 2013-04-25 22:36:00
|
Revision: 1973 http://sourceforge.net/p/modplug/code/1973 Author: saga-games Date: 2013-04-25 22:35:51 +0000 (Thu, 25 Apr 2013) Log Message: ----------- [Fix] Reading song message in 669, AMS, DMF, FAR, ULT and MTM files could lead to crashes (since OpenMPT 1.22.02) [Fix] Reading ZIP files could lead to crashes (since OpenMPT 1.22.02) [Mod] OpenMPT: Version is now 1.22.02.03 Modified Paths: -------------- trunk/OpenMPT/common/version.h trunk/OpenMPT/soundlib/Message.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/unarchiver/unarchiver.cpp trunk/OpenMPT/unarchiver/unarchiver.h Modified: trunk/OpenMPT/common/version.h =================================================================== --- trunk/OpenMPT/common/version.h 2013-04-25 19:40:22 UTC (rev 1972) +++ trunk/OpenMPT/common/version.h 2013-04-25 22:35:51 UTC (rev 1973) @@ -21,7 +21,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 22 #define VER_MINOR 02 -#define VER_MINORMINOR 02 +#define VER_MINORMINOR 03 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/soundlib/Message.cpp =================================================================== --- trunk/OpenMPT/soundlib/Message.cpp 2013-04-25 19:40:22 UTC (rev 1972) +++ trunk/OpenMPT/soundlib/Message.cpp 2013-04-25 22:35:51 UTC (rev 1973) @@ -143,7 +143,7 @@ for(size_t line = 0, fpos = 0, cpos = 0; line < numLines; line++, fpos += (lineLength + lineEndingLength), cpos += (lineLength + 1)) { append(str + fpos, std::min(lineLength, length - fpos)); - at(cpos + lineLength) = InternalLineEnding; + append(1, InternalLineEnding); // fix weird chars for(size_t lpos = 0; lpos < lineLength; lpos++) Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-25 19:40:22 UTC (rev 1972) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-04-25 22:35:51 UTC (rev 1973) @@ -607,12 +607,6 @@ m_dwCreatedWithVersion = MptVersion::num; } - // Adjust song / sample names - for(SAMPLEINDEX iSmp = 0; iSmp <= GetNumSamples(); iSmp++) - { - StringFixer::SetNullTerminator(m_szNames[iSmp]); - } - // Adjust channels for(CHANNELINDEX ich = 0; ich < MAX_BASECHANNELS; ich++) { @@ -634,6 +628,9 @@ ModSample *pSmp = Samples; for(SAMPLEINDEX nSmp = 0; nSmp < MAX_SAMPLES; nSmp++, pSmp++) { + // Adjust song / sample names + StringFixer::SetNullTerminator(m_szNames[nSmp]); + if(pSmp->pSample) { pSmp->SanitizeLoops(); @@ -1110,7 +1107,7 @@ void CSoundFile::PatternTranstionChnSolo(const CHANNELINDEX chnIndex) -//------------------------------------------------------------------------- +//------------------------------------------------------------------- { if(chnIndex >= m_nChannels) return; @@ -1124,7 +1121,7 @@ void CSoundFile::PatternTransitionChnUnmuteAll() -//---------------------------------------------------- +//---------------------------------------------- { for(CHANNELINDEX i = 0; i<m_nChannels; i++) { Modified: trunk/OpenMPT/unarchiver/unarchiver.cpp =================================================================== --- trunk/OpenMPT/unarchiver/unarchiver.cpp 2013-04-25 19:40:22 UTC (rev 1972) +++ trunk/OpenMPT/unarchiver/unarchiver.cpp 2013-04-25 22:35:51 UTC (rev 1973) @@ -13,8 +13,9 @@ #include "../soundlib/FileReader.h" CUnarchiver::CUnarchiver(FileReader &file, const std::vector<const char *> &extensions) : +ext(extensions), inFile(file), -zipArchive(inFile, extensions), +zipArchive(inFile, ext), rarArchive((LPBYTE)inFile.GetRawData(), inFile.GetLength()), lhaArchive((LPBYTE)inFile.GetRawData(), inFile.GetLength()), gzipArchive(inFile) Modified: trunk/OpenMPT/unarchiver/unarchiver.h =================================================================== --- trunk/OpenMPT/unarchiver/unarchiver.h 2013-04-25 19:40:22 UTC (rev 1972) +++ trunk/OpenMPT/unarchiver/unarchiver.h 2013-04-25 22:35:51 UTC (rev 1973) @@ -35,6 +35,7 @@ { protected: FileReader inFile; + const std::vector<const char *> ext; private: CZipArchive zipArchive; @@ -52,6 +53,6 @@ bool ExtractFile(); const char *GetComments(bool get); - CUnarchiver(FileReader &file, const std::vector<const char *> & extensions); + CUnarchiver(FileReader &file, const std::vector<const char *> &extensions); ~CUnarchiver(); }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |