From 749cdd6f44b4e26f7e46f72ae9b728cce81b4f6a Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 15 Apr 2013 18:32:00 -0400 Subject: PEGASUS: Add sanity check on the NItm resource being present --- engines/pegasus/pegasus.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/pegasus/pegasus.cpp') 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++) { -- cgit v1.2.3