diff options
-rw-r--r-- | engines/sci/engine/kvideo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp index fddfa3ba86..f3cf8b68d0 100644 --- a/engines/sci/engine/kvideo.cpp +++ b/engines/sci/engine/kvideo.cpp @@ -61,9 +61,17 @@ void playVideo(Graphics::VideoDecoder *videoDecoder, VideoState videoState) { uint16 x, y; + // Sanity check... if (videoState.x > 0 && videoState.y > 0 && isVMD) { x = videoState.x; y = videoState.y; + + if (x + width > screenWidth || y + height > screenHeight) { + // Happens in the Lighthouse demo + warning("VMD video won't fit on screen, centering it instead"); + x = (screenWidth - width) / 2; + y = (screenHeight - height) / 2; + } } else { x = (screenWidth - width) / 2; y = (screenHeight - height) / 2; |