aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-10-03 17:25:24 +0000
committerTorbjörn Andersson2004-10-03 17:25:24 +0000
commit4fcdba446e461a8e239b6179687cfb1dcff8526e (patch)
tree27866d5c54ddc50b15d69a43fc2c88f12c9989bf /scumm
parentff1cf82089751a6b11d2397115acb91e2baa00c8 (diff)
downloadscummvm-rg350-4fcdba446e461a8e239b6179687cfb1dcff8526e.tar.gz
scummvm-rg350-4fcdba446e461a8e239b6179687cfb1dcff8526e.tar.bz2
scummvm-rg350-4fcdba446e461a8e239b6179687cfb1dcff8526e.zip
Fixed bug #1039162 (Sam & Max intro crash) by making drawBox() do nothing
if the box's width or height is zero or less. svn-id: r15394
Diffstat (limited to 'scumm')
-rw-r--r--scumm/gfx.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 2bd74043ca..d8f3b8f9cc 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -868,12 +868,19 @@ void ScummEngine::drawBox(int x, int y, int x2, int y2, int color) {
else if (y2 > vs->h)
y2 = vs->h;
+ width = x2 - x;
+ height = y2 - y;
+
+ // This will happen in the Sam & Max intro - see bug #1039162 - where
+ // it would trigger an assertion in blit().
+
+ if (width <= 0 || height <= 0)
+ return;
+
markRectAsDirty(vs->number, x, x2, y, y2);
backbuff = vs->getPixels(x, y);
- width = x2 - x;
- height = y2 - y;
if (color == -1) {
if (vs->number != kMainVirtScreen)
error("can only copy bg to main window");