Fixes for WavReader to explictly handle "LIST" and "cue " chunks (RA2), and skip to EOF on unknown chunk
This commit is contained in:
committed by
RoosterDragon
parent
42954aa18e
commit
1b685955cd
@@ -46,6 +46,9 @@ namespace OpenRA.Mods.Common.FileFormats
|
||||
if ((s.Position & 1) == 1)
|
||||
s.ReadByte(); // Alignment
|
||||
|
||||
if (s.Position == s.Length)
|
||||
break; // Break if we aligned with end of stream
|
||||
|
||||
var blockType = s.ReadASCII(4);
|
||||
switch (blockType)
|
||||
{
|
||||
@@ -75,9 +78,13 @@ namespace OpenRA.Mods.Common.FileFormats
|
||||
dataOffset = s.Position;
|
||||
s.Position += dataSize;
|
||||
break;
|
||||
case "LIST":
|
||||
case "cue ":
|
||||
var listCueChunkSize = s.ReadInt32();
|
||||
s.ReadBytes(listCueChunkSize);
|
||||
break;
|
||||
default:
|
||||
var unknownChunkSize = s.ReadInt32();
|
||||
s.ReadBytes(unknownChunkSize);
|
||||
s.Position = s.Length; // Skip to end of stream
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user