diff options
author | Eugene Sandulenko | 2020-01-09 18:15:23 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2020-01-09 18:15:23 +0100 |
commit | b521eb3fd43c77f04e7de59450d132afd881d6fa (patch) | |
tree | d7ed9f9a0118a390e616981d42993b4a0f3a949f /engines/director | |
parent | b0d31a2afa00c8af9cd42891b82d897c95c1afc3 (diff) | |
download | scummvm-rg350-b521eb3fd43c77f04e7de59450d132afd881d6fa.tar.gz scummvm-rg350-b521eb3fd43c77f04e7de59450d132afd881d6fa.tar.bz2 scummvm-rg350-b521eb3fd43c77f04e7de59450d132afd881d6fa.zip |
DIRECTOR: Sanity checks on unsuccessful movie loading
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/resource.cpp | 6 | ||||
-rw-r--r-- | engines/director/score.cpp | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp index 2f4f589d72..1123d92e7c 100644 --- a/engines/director/resource.cpp +++ b/engines/director/resource.cpp @@ -63,8 +63,10 @@ Archive *DirectorEngine::openMainArchive(const Common::String movie) { _mainArchive = createArchive(); - if (!_mainArchive->openFile(movie)) - error("openMainArchive(): Could not open '%s'", movie.c_str()); + if (!_mainArchive->openFile(movie)) { + warning("openMainArchive(): Could not open '%s'", movie.c_str()); + return nullptr; + } return _mainArchive; } diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 67eb27b74e..ead93429e0 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -358,13 +358,13 @@ void Score::loadSpriteImages(bool isSharedCast) { Score::~Score() { - if (_surface) + if (_surface && _surface->w) _surface->free(); - if (_trailSurface) + if (_trailSurface && _trailSurface->w) _trailSurface->free(); - if (_backSurface) + if (_backSurface && _backSurface->w) _backSurface->free(); delete _backSurface; |