|
From: <man...@us...> - 2014-03-24 11:17:03
|
Revision: 3952
http://sourceforge.net/p/modplug/code/3952
Author: manxorist
Date: 2014-03-24 11:16:58 +0000 (Mon, 24 Mar 2014)
Log Message:
-----------
[Ref] Silence the last 3 warnings in default libopenmpt GCC builds.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_mdl.cpp
trunk/OpenMPT/soundlib/Load_mtm.cpp
Modified: trunk/OpenMPT/soundlib/Load_mdl.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mdl.cpp 2014-03-24 11:14:49 UTC (rev 3951)
+++ trunk/OpenMPT/soundlib/Load_mdl.cpp 2014-03-24 11:16:58 UTC (rev 3952)
@@ -447,9 +447,9 @@
const BYTE *ps = lpStream+dwPos+34+14*j;
while ((note < (UINT)(ps[1]+12)) && (note < NOTE_MAX))
{
- if (ps[0] < MAX_SAMPLES)
+ SAMPLEINDEX ismp = ps[0];
+ if(ismp < MAX_SAMPLES)
{
- int ismp = ps[0];
pIns->Keyboard[note] = ps[0];
Samples[ismp].nVolume = ps[2];
Samples[ismp].nPan = ps[4] << 1;
@@ -521,7 +521,7 @@
for (i = 0; i < nsamples; i++, dwPos += (pmsh->version > 0) ? sizeof(MDLSampleHeader) : sizeof(MDLSampleHeaderv0))
{
const MDLSampleHeaderCommon *info = reinterpret_cast<const MDLSampleHeaderCommon *>(lpStream + dwPos);
- if(info->sampleIndex >= MAX_SAMPLES || info->sampleIndex == 0)
+ if(!IsInRange(info->sampleIndex, 1, MAX_SAMPLES-1))
{
continue;
}
Modified: trunk/OpenMPT/soundlib/Load_mtm.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mtm.cpp 2014-03-24 11:14:49 UTC (rev 3951)
+++ trunk/OpenMPT/soundlib/Load_mtm.cpp 2014-03-24 11:16:58 UTC (rev 3952)
@@ -107,7 +107,6 @@
|| fileHeader.lastOrder > 127
|| fileHeader.numChannels > 32
|| fileHeader.numChannels == 0
- || fileHeader.numSamples >= MAX_SAMPLES
|| fileHeader.lastPattern >= MAX_PATTERNS
|| fileHeader.beatsPerTrack == 0
|| !file.CanRead(sizeof(MTMSampleHeader) * fileHeader.numSamples + 128 + 192 * fileHeader.numTracks + 64 * (fileHeader.lastPattern + 1) + fileHeader.commentSize))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|