fix: Add argument check

This commit is contained in:
Crsky
2026-03-17 11:05:12 +08:00
parent 60b0f0bf40
commit 387d6110ce

View File

@@ -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 ();