aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/detection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/detection.cpp')
-rw-r--r--engines/sci/detection.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 63fc95e04e..2a83c8e32a 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -232,7 +232,8 @@ Common::String getSierraGameId(ResourceManager *resMan) {
exportsOffset = READ_UINT16(script000->_buf + curOffset + 2);
break;
}
- } while (objType != 0);
+ curOffset += objLength - 4;
+ } while (objType != 0 && curOffset < script->size - 2);
// The game object is the first export. Script 0 is always at segment 1
reg_t gameObj = make_reg(1, exportsOffset);