aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-12-26 17:03:44 +0100
committerEugene Sandulenko2019-12-26 17:03:44 +0100
commit5375a2a048a5cbc5448ebd731927c9b843e7a571 (patch)
tree8ae83695dd6e5f3745a8e825ff1aad092e4928a6
parentdf5a4fb027c67bb8279b8c9fda2939ba0d6adfb0 (diff)
downloadscummvm-rg350-5375a2a048a5cbc5448ebd731927c9b843e7a571.tar.gz
scummvm-rg350-5375a2a048a5cbc5448ebd731927c9b843e7a571.tar.bz2
scummvm-rg350-5375a2a048a5cbc5448ebd731927c9b843e7a571.zip
COMMON: Add sanity check to MacResMan
-rw-r--r--common/macresman.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/macresman.cpp b/common/macresman.cpp
index ac78ea0bd0..29d3ddef99 100644
--- a/common/macresman.cpp
+++ b/common/macresman.cpp
@@ -376,7 +376,8 @@ bool MacResManager::isMacBinary(SeekableReadStream &stream) {
byte infoHeader[MBI_INFOHDR];
int resForkOffset = -1;
- stream.read(infoHeader, MBI_INFOHDR);
+ if (stream.read(infoHeader, MBI_INFOHDR) != MBI_INFOHDR)
+ return false;
if (infoHeader[MBI_ZERO1] == 0 && infoHeader[MBI_ZERO2] == 0 &&
infoHeader[MBI_ZERO3] == 0 && infoHeader[MBI_NAMELEN] <= MAXNAMELEN) {