mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 03:44:13 +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);
|
table_size *= 4 * (version+1);
|
||||||
if (table_size + 0x1c != names_offset)
|
if (table_size + 0x1c != names_offset)
|
||||||
return null;
|
return null;
|
||||||
if (data_offset != file.View.Reserve (0, data_offset))
|
if (data_offset > file.View.Reserve (0, data_offset))
|
||||||
return null;
|
return null;
|
||||||
int names_size = (int)(data_offset - names_offset);
|
int names_size = (int)(data_offset - names_offset);
|
||||||
var names = new byte[names_size];
|
var names = new byte[names_size];
|
||||||
|
@ -58,7 +58,7 @@ namespace GameRes.Formats
|
|||||||
uint dir_size = file.View.ReadUInt32 (12);
|
uint dir_size = file.View.ReadUInt32 (12);
|
||||||
if (dir_size < count * 0x17 || count > 0xfffff)
|
if (dir_size < count * 0x17 || count > 0xfffff)
|
||||||
return null;
|
return null;
|
||||||
if (dir_size != file.View.Reserve (0x20, dir_size))
|
if (dir_size > file.View.Reserve (0x20, dir_size))
|
||||||
return null;
|
return null;
|
||||||
var parser = new Parser (file, version, count, dir_size);
|
var parser = new Parser (file, version, count, dir_size);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user