From ebd6578dca351f2266e159d3f794809375ab1c2e Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 23 Sep 2018 03:54:04 +0400 Subject: [PATCH] (KAAS): fixed image header interpreter. --- ArcFormats/Kaas/ImageKAAS.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArcFormats/Kaas/ImageKAAS.cs b/ArcFormats/Kaas/ImageKAAS.cs index 1f9268ae..a22e1ff2 100644 --- a/ArcFormats/Kaas/ImageKAAS.cs +++ b/ArcFormats/Kaas/ImageKAAS.cs @@ -79,7 +79,7 @@ namespace GameRes.Formats.KAAS var file_len = stream.Length; uint comp_size1 = LittleEndian.ToUInt32 (header, 8); uint comp_size2 = LittleEndian.ToUInt32 (header, 12); - uint comp_size3 = LittleEndian.ToUInt16 (header, 16); + uint comp_size3 = (uint)(file_len - (0x12 + comp_size1 + comp_size2)); if (comp_size1 >= file_len || comp_size2 >= file_len || comp_size3 >= file_len) return null; return new PicMetaData