From e126af2070f079c020bb55729006356de2bd203f Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 12 Jun 2016 01:08:43 +0400 Subject: [PATCH] (SafOpener): added sanity check. --- ArcFormats/ArcSAF.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ArcFormats/ArcSAF.cs b/ArcFormats/ArcSAF.cs index a38f678f..3bed9afd 100644 --- a/ArcFormats/ArcSAF.cs +++ b/ArcFormats/ArcSAF.cs @@ -27,6 +27,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.IO; +using System.Linq; using GameRes.Compression; using GameRes.Utility; @@ -54,7 +55,7 @@ namespace GameRes.Formats.Lune DecryptIndex (index_buffer, count); var reader = new IndexReader (index_buffer, count); var dir = reader.Scan(); - if (0 == dir.Count) + if (0 == dir.Count || dir.Any (e => !e.CheckPlacement (file.MaxOffset))) return null; return new ArcFile (file, this, dir); }