|
From: <sag...@us...> - 2014-10-26 15:39:00
|
Revision: 4505
http://sourceforge.net/p/modplug/code/4505
Author: saga-games
Date: 2014-10-26 15:38:43 +0000 (Sun, 26 Oct 2014)
Log Message:
-----------
[Fix] Load extended song properties failed if MPT_EXTERNAL_SAMPLES is not enabled.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/SampleFormats.cpp
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2014-10-26 15:27:49 UTC (rev 4504)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2014-10-26 15:38:43 UTC (rev 4505)
@@ -650,11 +650,11 @@
sampleHeader.GetSampleFormat(fileHeader.cwtv).ReadSample(sample, file);
} else
{
-#ifdef MPT_EXTERNAL_SAMPLES
// External sample in MPTM file
- std::string filenameU8;
size_t strLen;
file.ReadVarInt(strLen);
+#ifdef MPT_EXTERNAL_SAMPLES
+ std::string filenameU8;
file.ReadString<mpt::String::maybeNullTerminated>(filenameU8, strLen);
mpt::PathString filename = mpt::PathString::FromUTF8(filenameU8);
@@ -675,6 +675,8 @@
{
sample.uFlags.reset(SMP_KEEPONDISK);
}
+#else
+ file.Skip(strLen);
#endif // MPT_EXTERNAL_SAMPLES
}
lastSampleOffset = std::max(lastSampleOffset, file.GetPosition());
Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp
===================================================================
--- trunk/OpenMPT/soundlib/SampleFormats.cpp 2014-10-26 15:27:49 UTC (rev 4504)
+++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2014-10-26 15:38:43 UTC (rev 4505)
@@ -1470,11 +1470,11 @@
sampleHeader.GetSampleFormat().ReadSample(Samples[nSample], file);
} else
{
-#ifdef MPT_EXTERNAL_SAMPLES
// External sample
- std::string filenameU8;
size_t strLen;
file.ReadVarInt(strLen);
+#ifdef MPT_EXTERNAL_SAMPLES
+ std::string filenameU8;
file.ReadString<mpt::String::maybeNullTerminated>(filenameU8, strLen);
mpt::PathString filename = mpt::PathString::FromUTF8(filenameU8);
@@ -1492,6 +1492,8 @@
{
sample.uFlags.reset(SMP_KEEPONDISK);
}
+#else
+ file.Skip(strLen);
#endif // MPT_EXTERNAL_SAMPLES
}
sample.PrecomputeLoops(*this, false);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|