(WAV): check for invalid encoding tag.

This commit is contained in:
morkt 2017-12-31 10:36:10 +04:00
parent 5e53eb5fa1
commit d8062b0240

View File

@ -113,9 +113,11 @@ namespace GameRes
public override SoundInput TryOpen (IBinaryStream file)
{
var header = file.ReadHeader (12);
var header = file.ReadHeader (0x16);
if (!header.AsciiEqual (8, "WAVE"))
return null;
if (header.ToUInt16 (0x14) == 0xFFFF)
return null;
file.Position = 0;
SoundInput sound = new WaveInput (file.AsStream);
if (EmbeddedFormats.Contains (sound.Format.FormatTag))