mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(PdOpener.TryOpen): check that index lies within file bounds.
This commit is contained in:
@@ -48,7 +48,7 @@ namespace GameRes.Formats.KAAS
|
|||||||
public override ArcFile TryOpen (ArcView file)
|
public override ArcFile TryOpen (ArcView file)
|
||||||
{
|
{
|
||||||
int index_offset = file.View.ReadByte (0);
|
int index_offset = file.View.ReadByte (0);
|
||||||
if (index_offset <= 2)
|
if (index_offset <= 2 || index_offset >= file.MaxOffset)
|
||||||
return null;
|
return null;
|
||||||
int key = file.View.ReadByte (1);
|
int key = file.View.ReadByte (1);
|
||||||
int count = 0xfff & file.View.ReadUInt16 (index_offset);
|
int count = 0xfff & file.View.ReadUInt16 (index_offset);
|
||||||
|
|||||||
Reference in New Issue
Block a user