mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
(WaveAudio.TryOpen): check for "WAVE" signature beforehand.
This commit is contained in:
parent
bd037316c3
commit
7c989a0150
@ -113,6 +113,10 @@ namespace GameRes
|
||||
|
||||
public override SoundInput TryOpen (IBinaryStream file)
|
||||
{
|
||||
var header = file.ReadHeader (12);
|
||||
if (!header.AsciiEqual (8, "WAVE"))
|
||||
return null;
|
||||
file.Position = 0;
|
||||
SoundInput sound = new WaveInput (file.AsStream);
|
||||
if (EmbeddedFormats.Contains (sound.Format.FormatTag))
|
||||
{
|
||||
@ -122,7 +126,6 @@ namespace GameRes
|
||||
var embedded = AudioFormat.Read (bin);
|
||||
if (null != embedded)
|
||||
{
|
||||
// sound.Dispose();
|
||||
sound = embedded;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user