From c8a656e1728b1569ee666a004f2c36d857966561 Mon Sep 17 00:00:00 2001 From: morkt Date: Thu, 21 Jan 2016 15:30:32 +0400 Subject: [PATCH] (DatOpener): additional sanity check. --- ArcFormats/MnoViolet/ArcMnoViolet.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ArcFormats/MnoViolet/ArcMnoViolet.cs b/ArcFormats/MnoViolet/ArcMnoViolet.cs index b0c8531b..4672a28e 100644 --- a/ArcFormats/MnoViolet/ArcMnoViolet.cs +++ b/ArcFormats/MnoViolet/ArcMnoViolet.cs @@ -52,7 +52,8 @@ namespace GameRes.Formats.MnoViolet return null; uint name_size = 100; uint index_size = (uint)((name_size+8) * count); - if (index_size > file.View.Reserve (4, index_size)) + uint first_offset = file.View.ReadUInt32 (4+name_size+4); + if (first_offset != (4 + index_size) || index_size > file.View.Reserve (4, index_size)) return null; var dir = new List (count); long index_offset = 4;