diff --git a/soundlib/Load_okt.cpp b/soundlib/Load_okt.cpp index 344ac8dd90f..abd6261e022 100644 --- a/soundlib/Load_okt.cpp +++ b/soundlib/Load_okt.cpp @@ -29,8 +29,8 @@ struct OktIffChunk 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) @@ -279,19 +279,6 @@ CSoundFile::ProbeResult CSoundFile::ProbeFileHeaderOKT(MemoryFileReader file, co { 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; } @@ -305,7 +292,6 @@ bool CSoundFile::ReadOKT(FileReader &file, ModLoadingFlags loadFlags) return false; } - // prepare some arrays to store offsets etc. std::vector patternChunks; std::vector sampleChunks; std::vector sample7bit; // 7-/8-bit sample @@ -322,15 +308,11 @@ bool CSoundFile::ReadOKT(FileReader &file, ModLoadingFlags loadFlags) { OktIffChunk iffHead; if(!file.ReadStruct(iffHead)) - { break; - } FileReader chunk = file.ReadChunk(iffHead.chunksize); if(!chunk.IsValid()) - { - break; - } + continue; switch(iffHead.signature) { @@ -408,12 +390,6 @@ bool CSoundFile::ReadOKT(FileReader &file, ModLoadingFlags loadFlags) sampleChunks.push_back(chunk); } break; - - default: - // Non-ASCII chunk ID? - if(iffHead.signature & 0x80808080) - return false; - break; } }