From 722d90750426d9beb6668a4d485d0cf436827718 Mon Sep 17 00:00:00 2001 From: morkt Date: Thu, 5 Mar 2015 17:37:22 +0400 Subject: [PATCH] (ReadMetaData): check unpacked bitmap signature. --- ArcFormats/ImageTGF.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ArcFormats/ImageTGF.cs b/ArcFormats/ImageTGF.cs index a3281d1f..d8f2d0ce 100644 --- a/ArcFormats/ImageTGF.cs +++ b/ArcFormats/ImageTGF.cs @@ -66,6 +66,8 @@ namespace GameRes.Formats.Tactics { reader.Unpack(); var bmp = reader.Data; + if (bmp[0] != 'B' || bmp[1] != 'M') + return null; return new TgfMetaData { Width = LittleEndian.ToUInt32 (bmp, 0x12),