(AniOpener): check filename extension.

This commit is contained in:
morkt 2017-02-25 02:01:34 +04:00
parent 25f9285181
commit 99b8faab23

View File

@ -57,6 +57,8 @@ namespace GameRes.Formats.Ags
public override ArcFile TryOpen (ArcView file)
{
if (!file.Name.EndsWith (".ani", StringComparison.InvariantCultureIgnoreCase))
return null;
uint first_offset = file.View.ReadUInt32 (0);
if (first_offset < 4 || file.MaxOffset > int.MaxValue || first_offset >= file.MaxOffset || 0 != (first_offset & 3))
return null;