aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins/graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/hopkins/graphics.cpp')
-rw-r--r--engines/hopkins/graphics.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index c7b6904335..0c06ef7f48 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -1171,9 +1171,12 @@ void GraphicsManager::displayDirtyRects() {
unlockScreen();
}
- byte *srcP = _videoPtr + WinScan * dstRect.top + (dstRect.left * 2);
- g_system->copyRectToScreen(srcP, WinScan, dstRect.left, dstRect.top,
- dstRect.width(), dstRect.height());
+ // If it's a valid rect, then copy it over
+ if (dstRect.isValidRect() && dstRect.width() > 0 && dstRect.height() > 0) {
+ byte *srcP = _videoPtr + WinScan * dstRect.top + (dstRect.left * 2);
+ g_system->copyRectToScreen(srcP, WinScan, dstRect.left, dstRect.top,
+ dstRect.width(), dstRect.height());
+ }
}
unlockScreen();