mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(SafOpener): added sanity check.
This commit is contained in:
@@ -27,6 +27,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.Composition;
|
using System.ComponentModel.Composition;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using GameRes.Compression;
|
using GameRes.Compression;
|
||||||
using GameRes.Utility;
|
using GameRes.Utility;
|
||||||
|
|
||||||
@@ -54,7 +55,7 @@ namespace GameRes.Formats.Lune
|
|||||||
DecryptIndex (index_buffer, count);
|
DecryptIndex (index_buffer, count);
|
||||||
var reader = new IndexReader (index_buffer, count);
|
var reader = new IndexReader (index_buffer, count);
|
||||||
var dir = reader.Scan();
|
var dir = reader.Scan();
|
||||||
if (0 == dir.Count)
|
if (0 == dir.Count || dir.Any (e => !e.CheckPlacement (file.MaxOffset)))
|
||||||
return null;
|
return null;
|
||||||
return new ArcFile (file, this, dir);
|
return new ArcFile (file, this, dir);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user