From 811edc9d7ed81db43d1fb17ef18f3cf92d3285ee Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 12 Mar 2017 19:57:58 +0100 Subject: [PATCH] DIRECTOR: Implement safety check while Shared Cast loading --- engines/director/score.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 27943e6a681..c92c0d07587 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -211,7 +211,8 @@ void Score::loadSpriteImages(bool isSharedCast) { if (isSharedCast) { debugC(4, kDebugImages, "Shared cast BMP: id: %d", imgId); pic = _vm->getSharedBMP()->getVal(imgId); - pic->seek(0); // TODO: this actually gets re-read every loop... we need to rewind it! + if (pic != NULL) + pic->seek(0); // TODO: this actually gets re-read every loop... we need to rewind it! } else if (_movieArchive->hasResource(MKTAG('B', 'I', 'T', 'D'), imgId)) { pic = _movieArchive->getResource(MKTAG('B', 'I', 'T', 'D'), imgId); }