From 387d6110ceef72405a7cb12029673ce1fc511314 Mon Sep 17 00:00:00 2001 From: Crsky Date: Tue, 17 Mar 2026 11:05:12 +0800 Subject: [PATCH] fix: Add argument check --- ArcFormats/KiriKiri/ImageTLG.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ArcFormats/KiriKiri/ImageTLG.cs b/ArcFormats/KiriKiri/ImageTLG.cs index 3d533b70..4c0acb21 100644 --- a/ArcFormats/KiriKiri/ImageTLG.cs +++ b/ArcFormats/KiriKiri/ImageTLG.cs @@ -1456,6 +1456,9 @@ namespace GameRes.Formats.KiriKiri if (0 == block_count) throw new NotImplementedException (); + if (layer >= layer_count) + throw new ArgumentOutOfRangeException (); + long[] dtbl = ReadArray (src, data_offset+dtbl_offset, 0x4C425444); if (0 == dtbl.Length || dtbl.Length != 1+2*block_count || dtbl[0] != dtbl.Length-1) throw new InvalidFormatException ();