additonal checks to reduce false positives.

This commit is contained in:
morkt
2016-07-10 12:18:38 +04:00
parent 9133adeab9
commit ebb6c91a73
2 changed files with 11 additions and 2 deletions

View File

@@ -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
{