aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2010-02-21 00:50:27 +0000
committerFilippos Karapetis2010-02-21 00:50:27 +0000
commit43ca6071eaa559d04988910491b3013664e9f396 (patch)
tree81791f66113958ba3906739f3607c0a7cdff0e7a /engines/sci
parent24b0622e6f4c5a57db820e6a1effb305742c1af7 (diff)
downloadscummvm-rg350-43ca6071eaa559d04988910491b3013664e9f396.tar.gz
scummvm-rg350-43ca6071eaa559d04988910491b3013664e9f396.tar.bz2
scummvm-rg350-43ca6071eaa559d04988910491b3013664e9f396.zip
Handle invalid rects in kCanBeHere(). Fixes some odd crashes in Iceman
svn-id: r48098
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/graphics/compare.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp
index 689c871e64..cf57d98b52 100644
--- a/engines/sci/graphics/compare.cpp
+++ b/engines/sci/graphics/compare.cpp
@@ -152,6 +152,9 @@ bool GfxCompare::kernelCanBeHere(reg_t curObject, reg_t listReference) {
checkRect.right = GET_SEL32V(_segMan, curObject, SELECTOR(brRight));
checkRect.bottom = GET_SEL32V(_segMan, curObject, SELECTOR(brBottom));
+ if (!checkRect.isValidRect()) // can occur in Iceman
+ return false;
+
adjustedRect = _coordAdjuster->onControl(checkRect);
signal = GET_SEL32V(_segMan, curObject, SELECTOR(signal));