(TryOpen): use IsSaneCount method.

This commit is contained in:
morkt 2015-12-18 13:32:18 +04:00
parent b951729993
commit 0a118f6911

View File

@ -68,7 +68,7 @@ namespace GameRes.Formats
using (var header = new BinaryReader (stream))
{
int entry_count = header.ReadInt32();
if (entry_count <= 0)
if (!IsSaneCount (entry_count))
return null;
index_size -= 4;
int average_entry_size = index_size / entry_count;