diff options
author | Eugene Sandulenko | 2017-03-16 21:34:51 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2017-03-16 21:34:51 +0000 |
commit | 2e5fa559d93718e60889136c903377de8963dc13 (patch) | |
tree | 1a4055e2fd5105fc0efaa7757a52135bf7bb0b23 /engines | |
parent | 27cc4d6fad47bd9445b0f9283737f660df463edf (diff) | |
download | scummvm-rg350-2e5fa559d93718e60889136c903377de8963dc13.tar.gz scummvm-rg350-2e5fa559d93718e60889136c903377de8963dc13.tar.bz2 scummvm-rg350-2e5fa559d93718e60889136c903377de8963dc13.zip |
DIRECTOR: Fix crash when Shared Cast is not present
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/resource.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp index 5a964c1687..62363bfc53 100644 --- a/engines/director/resource.cpp +++ b/engines/director/resource.cpp @@ -202,18 +202,18 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) { debug(0, "Loading Shared cast '%s'", filename.c_str()); - if (!shardcst->openFile(filename)) { - warning("No shared cast %s", filename.c_str()); - - return; - } - _sharedDIB = new Common::HashMap<int, Common::SeekableSubReadStreamEndian *>; _sharedSTXT = new Common::HashMap<int, Common::SeekableSubReadStreamEndian *>; _sharedSound = new Common::HashMap<int, Common::SeekableSubReadStreamEndian *>; _sharedBMP = new Common::HashMap<int, Common::SeekableSubReadStreamEndian *>; _sharedScore = new Score(this); + if (!shardcst->openFile(filename)) { + warning("No shared cast %s", filename.c_str()); + + return; + } + _sharedScore->setArchive(shardcst); if (shardcst->hasResource(MKTAG('F', 'O', 'N', 'D'), -1)) { |