DIRECTOR: Sanity checks on unsuccessful movie loading

This commit is contained in:
Eugene Sandulenko 2020-01-09 18:15:23 +01:00
parent b0d31a2afa
commit b521eb3fd4
2 changed files with 7 additions and 5 deletions

View File

@ -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;
}

View File

@ -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;