From 65ae716469a08fb778e52884985532bd178c91bd Mon Sep 17 00:00:00 2001 From: morkt Date: Thu, 19 Nov 2015 11:35:02 +0400 Subject: [PATCH] (AutoEntry): don't return file type for ambiguously detected files. --- ArcFormats/ArcCommon.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ArcFormats/ArcCommon.cs b/ArcFormats/ArcCommon.cs index 0fed2853..060ded7a 100644 --- a/ArcFormats/ArcCommon.cs +++ b/ArcFormats/ArcCommon.cs @@ -61,7 +61,10 @@ namespace GameRes.Formats return new AutoEntry (base_name, () => { uint signature = file.View.ReadUInt32 (offset); if (0 == signature) return null; - return FormatCatalog.Instance.LookupSignature (signature).FirstOrDefault(); + var res = FormatCatalog.Instance.LookupSignature (signature); + if (!res.Any() || res.Skip (1).Any()) // Count == 0 || Count > 1 + return null; + return res.First(); }) { Offset = offset }; }