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)
|
if ((s.Position & 1) == 1)
|
||||||
s.ReadByte(); // Alignment
|
s.ReadByte(); // Alignment
|
||||||
|
|
||||||
|
if (s.Position == s.Length)
|
||||||
|
break; // Break if we aligned with end of stream
|
||||||
|
|
||||||
var blockType = s.ReadASCII(4);
|
var blockType = s.ReadASCII(4);
|
||||||
switch (blockType)
|
switch (blockType)
|
||||||
{
|
{
|
||||||
@@ -75,9 +78,13 @@ namespace OpenRA.Mods.Common.FileFormats
|
|||||||
dataOffset = s.Position;
|
dataOffset = s.Position;
|
||||||
s.Position += dataSize;
|
s.Position += dataSize;
|
||||||
break;
|
break;
|
||||||
|
case "LIST":
|
||||||
|
case "cue ":
|
||||||
|
var listCueChunkSize = s.ReadInt32();
|
||||||
|
s.ReadBytes(listCueChunkSize);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
var unknownChunkSize = s.ReadInt32();
|
s.Position = s.Length; // Skip to end of stream
|
||||||
s.ReadBytes(unknownChunkSize);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user