Permalink
Browse files

SCI32: Fix segfault when SCI3 vocab isn't found

Seen when attempting to detect and/or run the Shivers 2 demo.

Closes gh-1106.
  • Loading branch information...
h3xx authored and csnover committed Jan 2, 2018
1 parent 6e2c702 commit 0c26da90bb7538fb8bbf866013993185467b194b
Showing with 3 additions and 0 deletions.
  1. +3 −0 engines/sci/resource.cpp
View
@@ -2918,6 +2918,9 @@ Common::String ResourceManager::findSierraGameId(const bool isBE) {
heap = findResource(ResourceId(kResourceTypeScript, 0), false);
Resource *vocab = findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SELECTORS), false);
if (!vocab)
return "";
const uint16 numSelectors = isBE ? vocab->getUint16BEAt(0) : vocab->getUint16LEAt(0);
for (uint16 i = 0; i < numSelectors; ++i) {
uint16 selectorOffset;

0 comments on commit 0c26da9

Please sign in to comment.