Author: sagamusix
Date: Sun Mar 17 17:33:42 2024
New Revision: 20414
URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20414
Log:
Merged revision(s) 20412 from trunk/OpenMPT:
[Fix] OKT: Don't reject files with non-ASCII chunk IDs. This fixes "katharsis - piano lesson.okta" which appears to have some leftover junk with unused sample data at the end of the file (https://www.un4seen.com/forum/?topic=15448.msg142562#msg142562).
........
Modified:
branches/OpenMPT-1.30/ (props changed)
branches/OpenMPT-1.30/soundlib/Load_okt.cpp
Modified: branches/OpenMPT-1.30/soundlib/Load_okt.cpp
==============================================================================
--- branches/OpenMPT-1.30/soundlib/Load_okt.cpp Sun Mar 17 17:33:20 2024 (r20413)
+++ branches/OpenMPT-1.30/soundlib/Load_okt.cpp Sun Mar 17 17:33:42 2024 (r20414)
@@ -29,8 +29,8 @@
idSBOD = MagicBE("SBOD"),
};
- uint32be signature; // IFF chunk name
- uint32be chunksize; // chunk size without header
+ uint32be signature; // IFF chunk name
+ uint32be chunksize; // chunk size without header
};
MPT_BINARY_STRUCT(OktIffChunk, 8)
@@ -322,19 +322,6 @@
{
return ProbeFailure;
}
- OktIffChunk iffHead;
- if(!file.ReadStruct(iffHead))
- {
- return ProbeWantMoreData;
- }
- if(iffHead.chunksize == 0)
- {
- return ProbeFailure;
- }
- if((iffHead.signature & 0x80808080u) != 0) // ASCII?
- {
- return ProbeFailure;
- }
MPT_UNREFERENCED_PARAMETER(pfilesize);
return ProbeSuccess;
}
@@ -348,7 +335,6 @@
return false;
}
- // prepare some arrays to store offsets etc.
std::vector<FileReader> patternChunks;
std::vector<FileReader> sampleChunks;
std::array<int8, 8> pairedChn{{}};
@@ -365,15 +351,11 @@
{
OktIffChunk iffHead;
if(!file.ReadStruct(iffHead))
- {
break;
- }
FileReader chunk = file.ReadChunk(iffHead.chunksize);
if(!chunk.IsValid())
- {
- break;
- }
+ continue;
switch(iffHead.signature)
{
@@ -451,12 +433,6 @@
sampleChunks.push_back(chunk);
}
break;
-
- default:
- // Non-ASCII chunk ID?
- if(iffHead.signature & 0x80808080)
- return false;
- break;
}
}
|