From 872842d40863b87ce2ba51cdccf9e8d108c5b7df Mon Sep 17 00:00:00 2001 From: morkt Date: Mon, 20 Feb 2017 12:19:47 +0400 Subject: [PATCH] (PSB): ignore parse errors caused by invalid key. --- ArcFormats/Emote/ArcPSB.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/ArcFormats/Emote/ArcPSB.cs b/ArcFormats/Emote/ArcPSB.cs index d595da6a..6f91ea97 100644 --- a/ArcFormats/Emote/ArcPSB.cs +++ b/ArcFormats/Emote/ArcPSB.cs @@ -74,17 +74,21 @@ namespace GameRes.Formats.Emote { foreach (var key in KnownKeys) { - if (reader.Parse (key)) + try { - var dir = reader.GetTextures(); - if (null == dir) - dir = reader.GetLayers(); - if (null == dir || 0 == dir.Count) - return null; - return new ArcFile (file, this, dir); + if (reader.Parse (key)) + { + var dir = reader.GetTextures(); + if (null == dir) + dir = reader.GetLayers(); + if (null == dir || 0 == dir.Count) + return null; + return new ArcFile (file, this, dir); + } + if (!reader.IsEncrypted) + break; } - if (!reader.IsEncrypted) - break; + catch { /* ignore parse errors caused by invalid key */ } } if (reader.ParseNonEncrypted()) {