From 6a84d6de7d3472389319a2268a814d03fb1ef24f Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 31 Aug 2016 10:54:44 +0400 Subject: [PATCH] (GAudio.TryOpen): quit on real ogg streams. --- ArcFormats/Leaf/AudioG.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ArcFormats/Leaf/AudioG.cs b/ArcFormats/Leaf/AudioG.cs index 5dd98bd2..b4cc999d 100644 --- a/ArcFormats/Leaf/AudioG.cs +++ b/ArcFormats/Leaf/AudioG.cs @@ -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;