mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
fix: Add offset check
This commit is contained in:
@@ -49,7 +49,7 @@ namespace GameRes.Formats.Edoire
|
|||||||
if (!file.View.AsciiEqual (0, "@ARCH000"))
|
if (!file.View.AsciiEqual (0, "@ARCH000"))
|
||||||
return null;
|
return null;
|
||||||
var index_offset = file.View.ReadInt64 (file.MaxOffset-8);
|
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;
|
return null;
|
||||||
var count = file.View.ReadInt32 (index_offset);
|
var count = file.View.ReadInt32 (index_offset);
|
||||||
if (!IsSaneCount (count))
|
if (!IsSaneCount (count))
|
||||||
|
|||||||
Reference in New Issue
Block a user