aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus/pegasus.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2013-04-15 18:32:00 -0400
committerMatthew Hoops2013-04-15 18:32:00 -0400
commit749cdd6f44b4e26f7e46f72ae9b728cce81b4f6a (patch)
treeef6f2e95497d79692aa51ee790d963dd7c176d2b /engines/pegasus/pegasus.cpp
parent582e464360fb2f038f4433c439d2947f74cb58d7 (diff)
downloadscummvm-rg350-749cdd6f44b4e26f7e46f72ae9b728cce81b4f6a.tar.gz
scummvm-rg350-749cdd6f44b4e26f7e46f72ae9b728cce81b4f6a.tar.bz2
scummvm-rg350-749cdd6f44b4e26f7e46f72ae9b728cce81b4f6a.zip
PEGASUS: Add sanity check on the NItm resource being present
Diffstat (limited to 'engines/pegasus/pegasus.cpp')
-rw-r--r--engines/pegasus/pegasus.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index 449fa20579..2dae8f4f60 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -239,6 +239,9 @@ bool PegasusEngine::detectOpeningClosingDirectory() {
void PegasusEngine::createItems() {
Common::SeekableReadStream *res = _resFork->getResource(MKTAG('N', 'I', 't', 'm'), 0x80);
+ if (!res)
+ error("Couldn't find neighborhood items resource");
+
uint16 entryCount = res->readUint16BE();
for (uint16 i = 0; i < entryCount; i++) {