diff options
author | Paul Gilbert | 2016-11-09 22:03:40 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-11-09 22:03:40 -0500 |
commit | 7880b1767636a4cea1e5f1a918e083f784b44674 (patch) | |
tree | 0cfd7dfd04107d1fc20b10baf338eab52bac4294 | |
parent | 3f1549824dacfaffe7dc21258002d075b57a6cf9 (diff) | |
download | scummvm-rg350-7880b1767636a4cea1e5f1a918e083f784b44674.tar.gz scummvm-rg350-7880b1767636a4cea1e5f1a918e083f784b44674.tar.bz2 scummvm-rg350-7880b1767636a4cea1e5f1a918e083f784b44674.zip |
TITANIC: Gracefully handle cases of specified sounds missing
-rw-r--r-- | engines/titanic/support/simple_file.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/titanic/support/simple_file.cpp b/engines/titanic/support/simple_file.cpp index 7e3cea35be..65d2c85273 100644 --- a/engines/titanic/support/simple_file.cpp +++ b/engines/titanic/support/simple_file.cpp @@ -467,7 +467,7 @@ void SimpleFile::skipSpaces() { /*------------------------------------------------------------------------*/ bool StdCWadFile::open(const Common::String &filename) { - File f; + Common::File f; CString name = filename; // Check for whether it is indeed a file/resource pair @@ -476,9 +476,11 @@ bool StdCWadFile::open(const Common::String &filename) { if (idx < 0) { // Nope, so open up file for standard reading assert(!name.empty()); - f.open(name); + if (!f.open(name)) + return false; SimpleFile::open(f.readStream(f.size())); + f.close(); return true; } @@ -489,7 +491,8 @@ bool StdCWadFile::open(const Common::String &filename) { int resIndex = resStr.readInt(); // Open up the index for access - f.open(fname); + if (!f.open(fname)) + return false; int indexSize = f.readUint32LE() / 4; assert(resIndex < indexSize); |