diff options
author | Colin Snover | 2016-08-11 20:49:11 -0500 |
---|---|---|
committer | Colin Snover | 2016-08-12 09:28:46 -0500 |
commit | 1fc21de2fc2dfc69b7b5cab9673f645dbcb2cf9d (patch) | |
tree | 07e5e1bde9cdbe223eef3bd4b5f101e4fdf55ed4 | |
parent | 774056ea4c2fc9ba6b841e02de896a61de7d6055 (diff) | |
download | scummvm-rg350-1fc21de2fc2dfc69b7b5cab9673f645dbcb2cf9d.tar.gz scummvm-rg350-1fc21de2fc2dfc69b7b5cab9673f645dbcb2cf9d.tar.bz2 scummvm-rg350-1fc21de2fc2dfc69b7b5cab9673f645dbcb2cf9d.zip |
SCI32: Fix crash when kShowMovie is called but the video cannot be found
-rw-r--r-- | engines/sci/graphics/video32.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp index 90ead6b101..bc1cf0547b 100644 --- a/engines/sci/graphics/video32.cpp +++ b/engines/sci/graphics/video32.cpp @@ -161,6 +161,9 @@ AVIPlayer::IOStatus AVIPlayer::open(const Common::String &fileName) { } AVIPlayer::IOStatus AVIPlayer::init1x(const int16 x, const int16 y, int16 width, int16 height) { + if (_status == kAVINotOpen) { + return kIOFileNotFound; + } _pixelDouble = false; @@ -189,7 +192,7 @@ AVIPlayer::IOStatus AVIPlayer::init1x(const int16 x, const int16 y, int16 width, // SCI2.1mid uses init2x to draw a pixel-doubled AVI, but SCI2 has only the // one play routine which automatically pixel-doubles in hi-res mode if (getSciVersion() == SCI_VERSION_2) { - // NOTE: This is somewhat of a hack; credits.avi from GK1 is not + // This is somewhat of a hack; credits.avi from GK1 is not // rendered correctly in SSCI because it is a 640x480 video, but the // game script gives the wrong dimensions. Since this is the only // high-resolution AVI ever used, just set the draw rectangle to draw @@ -216,6 +219,10 @@ AVIPlayer::IOStatus AVIPlayer::init1x(const int16 x, const int16 y, int16 width, } AVIPlayer::IOStatus AVIPlayer::init2x(const int16 x, const int16 y) { + if (_status == kAVINotOpen) { + return kIOFileNotFound; + } + _drawRect.left = x; _drawRect.top = y; _drawRect.right = x + _decoder->getWidth() * 2; @@ -283,6 +290,10 @@ void AVIPlayer::init() { } AVIPlayer::IOStatus AVIPlayer::play(const int16 from, const int16 to, const int16, const bool async) { + if (_status == kAVINotOpen) { + return kIOFileNotFound; + } + if (from >= 0 && to > 0 && from <= to) { _decoder->seekToFrame(from); _decoder->setEndFrame(to); |