mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +08:00
(BgiAudio.TryOpen): check stream position against file length.
This commit is contained in:
parent
46bd0a5e47
commit
4bfdc502e4
@ -49,9 +49,10 @@ namespace GameRes.Formats.BGI
|
|||||||
if (!Binary.AsciiEqual (header, 4, "bw "))
|
if (!Binary.AsciiEqual (header, 4, "bw "))
|
||||||
return null;
|
return null;
|
||||||
uint offset = LittleEndian.ToUInt32 (header, 0);
|
uint offset = LittleEndian.ToUInt32 (header, 0);
|
||||||
file.Seek (offset, SeekOrigin.Begin);
|
if (offset >= file.Length)
|
||||||
|
return null;
|
||||||
|
|
||||||
var input = new StreamRegion (file, file.Position);
|
var input = new StreamRegion (file, offset);
|
||||||
return new OggInput (input);
|
return new OggInput (input);
|
||||||
// input is left undisposed in case of exception.
|
// input is left undisposed in case of exception.
|
||||||
}
|
}
|
||||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion ("1.1.9.417")]
|
[assembly: AssemblyVersion ("1.1.9.418")]
|
||||||
[assembly: AssemblyFileVersion ("1.1.9.417")]
|
[assembly: AssemblyFileVersion ("1.1.9.418")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user