[Scummvm-cvs-logs] SF.net SVN: scummvm:[42821] scummvm/trunk/graphics/sjis.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Jul 26 16:19:02 CEST 2009


Revision: 42821
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42821&view=rev
Author:   lordhoto
Date:     2009-07-26 14:19:02 +0000 (Sun, 26 Jul 2009)

Log Message:
-----------
Reflect code to test the magic bytes in the sjis.fnt header.

Modified Paths:
--------------
    scummvm/trunk/graphics/sjis.cpp

Modified: scummvm/trunk/graphics/sjis.cpp
===================================================================
--- scummvm/trunk/graphics/sjis.cpp	2009-07-26 14:18:49 UTC (rev 42820)
+++ scummvm/trunk/graphics/sjis.cpp	2009-07-26 14:19:02 UTC (rev 42821)
@@ -28,6 +28,7 @@
 
 #include "common/debug.h"
 #include "common/archive.h"
+#include "common/endian.h"
 
 namespace Graphics {
 
@@ -232,7 +233,15 @@
 	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) {
 		delete data;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list