mirror of
https://github.com/crskycode/GARbro.git
synced 2026-06-09 15:19:07 +08:00
(TgfFormat): additional input sanity checks.
This commit is contained in:
@@ -60,7 +60,7 @@ namespace GameRes.Formats.Tactics
|
||||
return null;
|
||||
uint length = LittleEndian.ToUInt32 (header, 0);
|
||||
int chunk_size = LittleEndian.ToInt32 (header, 4);
|
||||
if (length > 0xffffff)
|
||||
if (length > 0xffffff || chunk_size <= 0 || length < chunk_size)
|
||||
return null;
|
||||
using (var reader = new Reader (stream, (uint)Math.Max (0x20, chunk_size+2), chunk_size))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user