additional sanity checks.

This commit is contained in:
morkt
2016-01-18 20:35:43 +04:00
parent 2bae9b188b
commit 38e87316ab
3 changed files with 5 additions and 2 deletions

View File

@@ -44,7 +44,7 @@ namespace GameRes.Formats.Propeller
{
uint index_offset = file.View.ReadUInt32 (0);
int count = file.View.ReadInt32 (4);
if (index_offset >= file.MaxOffset || !IsSaneCount (count))
if (index_offset < 8 || index_offset >= file.MaxOffset || !IsSaneCount (count))
return null;
uint index_size = (uint)count * 0x28u;
if (index_size > file.MaxOffset - index_offset)