mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(Jukkenshitsu): additional sanity checks.
This commit is contained in:
@@ -78,7 +78,7 @@ namespace GameRes.Formats.Jikkenshitsu
|
|||||||
if (header.ToInt32 (4) != 0)
|
if (header.ToInt32 (4) != 0)
|
||||||
return null;
|
return null;
|
||||||
int flags = header.ToUInt16 (0);
|
int flags = header.ToUInt16 (0);
|
||||||
if ((flags & ~0xFF) != 0)
|
if ((flags & ~0xFF) != 0 || header[2] != 1)
|
||||||
return null;
|
return null;
|
||||||
var info = new SpMetaData {
|
var info = new SpMetaData {
|
||||||
Width = header.ToUInt16 (0x16),
|
Width = header.ToUInt16 (0x16),
|
||||||
@@ -87,6 +87,9 @@ namespace GameRes.Formats.Jikkenshitsu
|
|||||||
Flags = flags,
|
Flags = flags,
|
||||||
Colors = header.ToUInt16 (0x1E),
|
Colors = header.ToUInt16 (0x1E),
|
||||||
};
|
};
|
||||||
|
if (info.Width == 0 || info.Width > 0x2000 || info.Height == 0 || info.Height > 0x2000 ||
|
||||||
|
info.Colors > 0x100)
|
||||||
|
return null;
|
||||||
if (info.IsEncrypted)
|
if (info.IsEncrypted)
|
||||||
{
|
{
|
||||||
if (null == DefaultKey)
|
if (null == DefaultKey)
|
||||||
|
|||||||
Reference in New Issue
Block a user