aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLe Philousophe2019-05-30 12:08:28 +0200
committerEugene Sandulenko2019-06-01 22:43:48 +0200
commitbd8698897dbcba425a63255ebc2edf9c48cfb814 (patch)
tree3c6a872a1914cfde204ba5ef5131eefd6a7f6836
parentd3c33364d7fe18cfd330a7510f2fa5ef96a48307 (diff)
downloadscummvm-rg350-bd8698897dbcba425a63255ebc2edf9c48cfb814.tar.gz
scummvm-rg350-bd8698897dbcba425a63255ebc2edf9c48cfb814.tar.bz2
scummvm-rg350-bd8698897dbcba425a63255ebc2edf9c48cfb814.zip
CRYOMNI3D: Better check of sprites magic
-rw-r--r--engines/cryomni3d/sprites.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/cryomni3d/sprites.cpp b/engines/cryomni3d/sprites.cpp
index 309c36f3a9..23f8c43d06 100644
--- a/engines/cryomni3d/sprites.cpp
+++ b/engines/cryomni3d/sprites.cpp
@@ -54,13 +54,13 @@ Sprites::~Sprites() {
}
void Sprites::loadSprites(Common::ReadStream &spr_fl) {
- byte magic[4];
-
while (true) {
- if (spr_fl.read(magic, sizeof(magic)) == 0) {
+ uint32 magic = spr_fl.readUint32BE();
+ if (spr_fl.eos()) {
+ // We are EOS so last read likely failed
break;
}
- if (memcmp(magic, "SPRI", sizeof(magic))) {
+ if (magic != MKTAG('S', 'P', 'R', 'I')) {
error("Invalid sprite magic");
}