Author: sagamusix
Date: Sun Mar 17 17:34:14 2024
New Revision: 20416
URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20416
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.28/ (props changed)
branches/OpenMPT-1.28/soundlib/Load_okt.cpp
Modified: branches/OpenMPT-1.28/soundlib/Load_okt.cpp
==============================================================================
--- branches/OpenMPT-1.28/soundlib/Load_okt.cpp Sun Mar 17 17:33:56 2024 (r20415)
+++ branches/OpenMPT-1.28/soundlib/Load_okt.cpp Sun Mar 17 17:34:14 2024 (r20416)
@@ -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)
@@ -261,19 +261,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;
}
@@ -287,7 +274,6 @@
return false;
}
- // prepare some arrays to store offsets etc.
std::vector<FileReader> patternChunks;
std::vector<FileReader> sampleChunks;
std::vector<bool> sample7bit; // 7-/8-bit sample
@@ -304,15 +290,11 @@
{
OktIffChunk iffHead;
if(!file.ReadStruct(iffHead))
- {
break;
- }
FileReader chunk = file.ReadChunk(iffHead.chunksize);
if(!chunk.IsValid())
- {
- break;
- }
+ continue;
switch(iffHead.signature)
{
@@ -390,12 +372,6 @@
sampleChunks.push_back(chunk);
}
break;
-
- default:
- // Non-ASCII chunk ID?
- if(iffHead.signature & 0x80808080)
- return false;
- break;
}
}
|