(TryOpen): check file count against zero.

This commit is contained in:
morkt
2015-06-17 17:38:35 +04:00
parent 147ef67c7d
commit 53e8be6020

View File

@@ -65,7 +65,7 @@ namespace GameRes.Formats.Qlie
if (pack_version != 2)
throw new NotSupportedException ("Not supported QLIE archive version");
int count = file.View.ReadInt32 (index_offset+0x10);
if (count < 0 || count > 0xfffff)
if (count <= 0 || count > 0xfffff)
return null;
index_offset = file.View.ReadInt64 (index_offset+0x14);
if (index_offset < 0 || index_offset >= file.MaxOffset)