mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 20:04:13 +08:00
fixed some IBinaryStream migration aftermath.
This commit is contained in:
parent
8ff76d59d6
commit
77dc85f5be
@ -47,6 +47,7 @@ namespace GameRes.Formats.Cri
|
|||||||
uint unpacked_size = stream.Signature;
|
uint unpacked_size = stream.Signature;
|
||||||
if (unpacked_size <= 0x20 || unpacked_size > 0x5000000) // ~83MB
|
if (unpacked_size <= 0x20 || unpacked_size > 0x5000000) // ~83MB
|
||||||
return null;
|
return null;
|
||||||
|
stream.Position = 4;
|
||||||
using (var lzss = new LzssStream (stream.AsStream, LzssMode.Decompress, true))
|
using (var lzss = new LzssStream (stream.AsStream, LzssMode.Decompress, true))
|
||||||
using (var input = new SeekableStream (lzss))
|
using (var input = new SeekableStream (lzss))
|
||||||
using (var xtx = new BinaryStream (input, stream.Name))
|
using (var xtx = new BinaryStream (input, stream.Name))
|
||||||
|
@ -69,6 +69,7 @@ namespace GameRes.Formats.Ikura
|
|||||||
case 0x48474948: bpp = 16; break;
|
case 0x48474948: bpp = 16; break;
|
||||||
default: return null;
|
default: return null;
|
||||||
}
|
}
|
||||||
|
stream.Position = 4;
|
||||||
uint width = stream.ReadUInt16();
|
uint width = stream.ReadUInt16();
|
||||||
uint height = stream.ReadUInt16();
|
uint height = stream.ReadUInt16();
|
||||||
return new ImageMetaData {
|
return new ImageMetaData {
|
||||||
|
@ -51,7 +51,7 @@ namespace GameRes.Formats.Unknown
|
|||||||
|
|
||||||
public override ImageMetaData ReadMetaData (IBinaryStream stream)
|
public override ImageMetaData ReadMetaData (IBinaryStream stream)
|
||||||
{
|
{
|
||||||
int signature = (int)~stream.Signature;
|
int signature = ~stream.ReadInt32();
|
||||||
int mode = (signature & 0x70) >> 4; // v6
|
int mode = (signature & 0x70) >> 4; // v6
|
||||||
if (0 != (mode & 4))
|
if (0 != (mode & 4))
|
||||||
return null;
|
return null;
|
||||||
|
@ -44,6 +44,7 @@ namespace GameRes.Formats.Ivory
|
|||||||
uint height = wh >> 16;
|
uint height = wh >> 16;
|
||||||
if (0 == width || width > 800 || 0 == height || height > 600)
|
if (0 == width || width > 800 || 0 == height || height > 600)
|
||||||
return null;
|
return null;
|
||||||
|
stream.Position = 4;
|
||||||
if (!IsValidInput (stream.AsStream, width, height))
|
if (!IsValidInput (stream.AsStream, width, height))
|
||||||
return null;
|
return null;
|
||||||
return new ImageMetaData { Width = width, Height = height, BPP = 24 };
|
return new ImageMetaData { Width = width, Height = height, BPP = 24 };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user