(GAudio.TryOpen): quit on real ogg streams.

This commit is contained in:
morkt 2016-08-31 10:54:44 +04:00
parent 7aa279eb3a
commit 6a84d6de7d

View File

@ -48,6 +48,8 @@ namespace GameRes.Formats.Leaf
var header = new byte[0x1C];
if (header.Length != file.Read (header, 0, header.Length))
return null;
if (Binary.AsciiEqual (header, "OggS") || Binary.AsciiEqual (header, "RIFF"))
return null;
if (header[4] != 0 || header[5] != 2 || LittleEndian.ToInt64 (header, 6) != 0)
return null;
file.Position = 0;