aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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) {