From 4b27c43b0aa9074205fc5aef0ee45adb1a55f49a Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 26 Jul 2009 14:19:02 +0000 Subject: Reflect code to test the magic bytes in the sjis.fnt header. svn-id: r42821 --- graphics/sjis.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'graphics') diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp index 589e27fd43..f1e82fa3e4 100644 --- a/graphics/sjis.cpp +++ b/graphics/sjis.cpp @@ -28,6 +28,7 @@ #include "common/debug.h" #include "common/archive.h" +#include "common/endian.h" namespace Graphics { @@ -232,6 +233,14 @@ bool FontSjisSVM::loadData() { Common::SeekableReadStream *data = SearchMan.createReadStreamForMember("SJIS.FNT"); if (!data) return false; + + uint32 magic1 = data->readUint32BE(); + uint32 magic2 = data->readUint32BE(); + + if (magic1 != MKID_BE('SCVM') || magic2 != MKID_BE('SJIS')) { + delete data; + return false; + } uint32 version = data->readUint32BE(); if (version != 1) { -- cgit v1.2.3