fix: Add offset check

This commit is contained in:
Crsky
2026-02-02 20:01:10 +08:00
parent 5893179d92
commit 66e4e40bff

View File

@@ -49,7 +49,7 @@ namespace GameRes.Formats.Edoire
if (!file.View.AsciiEqual (0, "@ARCH000"))
return null;
var index_offset = file.View.ReadInt64 (file.MaxOffset-8);
if (index_offset >= file.MaxOffset-12)
if (index_offset <= 0 || index_offset >= file.MaxOffset-12)
return null;
var count = file.View.ReadInt32 (index_offset);
if (!IsSaneCount (count))