mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 13:45:34 +08:00
(PmpFormat.ReadMetaData): use PeekByte instead of ReadByte.
This commit is contained in:
parent
57e56e1f2a
commit
c7ba369605
@ -48,11 +48,10 @@ namespace GameRes.Formats.ScenePlayer
|
|||||||
|
|
||||||
public override ImageMetaData ReadMetaData (IBinaryStream stream)
|
public override ImageMetaData ReadMetaData (IBinaryStream stream)
|
||||||
{
|
{
|
||||||
int first = stream.ReadByte() ^ 0x21;
|
int first = stream.PeekByte() ^ 0x21;
|
||||||
if (first != 0x78) // doesn't look like zlib stream
|
if (first != 0x78) // doesn't look like zlib stream
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
stream.Position = 0;
|
|
||||||
using (var input = new XoredStream (stream.AsStream, 0x21, true))
|
using (var input = new XoredStream (stream.AsStream, 0x21, true))
|
||||||
using (var zstream = new ZLibStream (input, CompressionMode.Decompress))
|
using (var zstream = new ZLibStream (input, CompressionMode.Decompress))
|
||||||
using (var bmp = new BinaryStream (zstream, stream.Name))
|
using (var bmp = new BinaryStream (zstream, stream.Name))
|
||||||
|
Loading…
Reference in New Issue
Block a user