From b171ac9b4b88dff957be388cae3f1bb32a5c154b Mon Sep 17 00:00:00 2001 From: morkt Date: Mon, 20 Aug 2018 14:38:49 +0400 Subject: [PATCH] (GP8): recognize non-zero coordinates. --- ArcFormats/elf/ImageGP8.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ArcFormats/elf/ImageGP8.cs b/ArcFormats/elf/ImageGP8.cs index b56f999a..5a0d53aa 100644 --- a/ArcFormats/elf/ImageGP8.cs +++ b/ArcFormats/elf/ImageGP8.cs @@ -43,7 +43,9 @@ namespace GameRes.Formats.Elf { if (file.Length <= 0x408) return null; - if (0 != file.ReadInt32()) + int x = file.ReadInt16(); + int y = file.ReadInt16(); + if (x < 0 || y < 0 || x > 0x300 || y > 0x300) return null; int w = file.ReadInt16(); int h = file.ReadInt16();