mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-23 19:34:15 +08:00
correctly check reserved view size.
This commit is contained in:
parent
116344ee9b
commit
13674f2e11
@ -85,7 +85,7 @@ namespace GameRes.Formats.Majiro
|
||||
table_size *= 4 * (version+1);
|
||||
if (table_size + 0x1c != names_offset)
|
||||
return null;
|
||||
if (data_offset != file.View.Reserve (0, data_offset))
|
||||
if (data_offset > file.View.Reserve (0, data_offset))
|
||||
return null;
|
||||
int names_size = (int)(data_offset - names_offset);
|
||||
var names = new byte[names_size];
|
||||
|
@ -58,7 +58,7 @@ namespace GameRes.Formats
|
||||
uint dir_size = file.View.ReadUInt32 (12);
|
||||
if (dir_size < count * 0x17 || count > 0xfffff)
|
||||
return null;
|
||||
if (dir_size != file.View.Reserve (0x20, dir_size))
|
||||
if (dir_size > file.View.Reserve (0x20, dir_size))
|
||||
return null;
|
||||
var parser = new Parser (file, version, count, dir_size);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user