aboutsummaryrefslogtreecommitdiff
path: root/graphics/sjis.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2009-07-26 14:19:02 +0000
committerJohannes Schickel2009-07-26 14:19:02 +0000
commit4b27c43b0aa9074205fc5aef0ee45adb1a55f49a (patch)
tree4f42fa61d105a0a998afec5b9a92fad65e3aa68c /graphics/sjis.cpp
parent84c0bf22d2efd12f8d6391c08da05485487a219e (diff)
downloadscummvm-rg350-4b27c43b0aa9074205fc5aef0ee45adb1a55f49a.tar.gz
scummvm-rg350-4b27c43b0aa9074205fc5aef0ee45adb1a55f49a.tar.bz2
scummvm-rg350-4b27c43b0aa9074205fc5aef0ee45adb1a55f49a.zip
Reflect code to test the magic bytes in the sjis.fnt header.
svn-id: r42821
Diffstat (limited to 'graphics/sjis.cpp')
-rw-r--r--graphics/sjis.cpp9
1 files changed, 9 insertions, 0 deletions
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) {