diff options
author | Colin Snover | 2016-08-11 20:49:11 -0500 |
---|---|---|
committer | Colin Snover | 2016-08-11 20:50:33 -0500 |
commit | 93b06f4a9e08de281ee7eb9c780ceac147c3fb23 (patch) | |
tree | 90087d21c6c97a8227f4cb299c8dec3291d3d96c /engines/sci | |
parent | cdab24aa07c18ad4a25a1659f7fca15cca5e358e (diff) | |
download | scummvm-rg350-93b06f4a9e08de281ee7eb9c780ceac147c3fb23.tar.gz scummvm-rg350-93b06f4a9e08de281ee7eb9c780ceac147c3fb23.tar.bz2 scummvm-rg350-93b06f4a9e08de281ee7eb9c780ceac147c3fb23.zip |
SCI32: Fix crash when kShowMovie is called but the video cannot be found
Diffstat (limited to 'engines/sci')
-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 e8baed2c76..0dde86a65d 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); |