mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 20:04:13 +08:00
additonal checks to reduce false positives.
This commit is contained in:
parent
9133adeab9
commit
ebb6c91a73
@ -69,7 +69,9 @@ namespace GameRes.Formats.Eushully
|
||||
int palette_size = reader.ReadInt32();
|
||||
uint width = reader.ReadUInt16();
|
||||
uint height = reader.ReadUInt16();
|
||||
if (0 == palette_size || 0 == width || 0 == height || palette_size >= stream.Length)
|
||||
if (palette_size <= 0 || 0 == width || 0 == height || palette_size >= stream.Length)
|
||||
return null;
|
||||
if (bpp <= 8 && palette_size > 0x100)
|
||||
return null;
|
||||
return new GpMetaData
|
||||
{
|
||||
|
@ -90,7 +90,13 @@ namespace GameRes.Formats.Selen
|
||||
++count;
|
||||
if (count > 0x7f)
|
||||
return null;
|
||||
m_input.Seek (b > 0x7f ? 1 : count, SeekOrigin.Current);
|
||||
if (b > 0x7f)
|
||||
{
|
||||
if (-1 == m_input.ReadByte())
|
||||
return null;
|
||||
}
|
||||
else
|
||||
m_input.Seek (count, SeekOrigin.Current);
|
||||
|
||||
key_lines.Clear();
|
||||
key_lines.AddRange (scan_lines.Keys);
|
||||
@ -118,6 +124,7 @@ namespace GameRes.Formats.Selen
|
||||
var valid_lines = from line in scan_lines where line.Key == line.Value
|
||||
orderby line.Key
|
||||
select line.Key;
|
||||
bool is_eof = -1 == m_input.ReadByte();
|
||||
foreach (var width in valid_lines)
|
||||
{
|
||||
int height = Math.DivRem (total, width, out rem);
|
||||
|
Loading…
x
Reference in New Issue
Block a user