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