aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/compare.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2010-02-06 15:58:59 +0000
committerFilippos Karapetis2010-02-06 15:58:59 +0000
commitb12437bbfcf22def9d2e20b3fc95fd76dd47636b (patch)
tree51551e564d9b9b9f0212abaa8b4c33ec63592eda /engines/sci/graphics/compare.cpp
parent742ddb7979e0958adb1bb7944bf450da964df6a9 (diff)
downloadscummvm-rg350-b12437bbfcf22def9d2e20b3fc95fd76dd47636b.tar.gz
scummvm-rg350-b12437bbfcf22def9d2e20b3fc95fd76dd47636b.tar.bz2
scummvm-rg350-b12437bbfcf22def9d2e20b3fc95fd76dd47636b.zip
Don't try and manipulate invalid views (i.e. views with view ID -1/65535, which are most likely the currently missing dynamically constructed text views). Torin chapter 1 starts now (and dies shortly afterwards, but that's a different issue)
svn-id: r47930
Diffstat (limited to 'engines/sci/graphics/compare.cpp')
-rw-r--r--engines/sci/graphics/compare.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp
index ba2fc7e417..5c7d932a33 100644
--- a/engines/sci/graphics/compare.cpp
+++ b/engines/sci/graphics/compare.cpp
@@ -116,6 +116,9 @@ void GfxCompare::kernelSetNowSeen(reg_t objectReference) {
GfxView *view = NULL;
Common::Rect celRect(0, 0);
GuiResourceId viewId = (GuiResourceId)GET_SEL32V(_segMan, objectReference, SELECTOR(view));
+ if (viewId == 0xFFFF) // invalid view
+ return;
+
int16 loopNo = GET_SEL32V(_segMan, objectReference, SELECTOR(loop));
int16 celNo = GET_SEL32V(_segMan, objectReference, SELECTOR(cel));
int16 x = (int16)GET_SEL32V(_segMan, objectReference, SELECTOR(x));
@@ -182,6 +185,9 @@ void GfxCompare::kernelBaseSetter(reg_t object) {
int16 loopNo = GET_SEL32V(_segMan, object, SELECTOR(loop));
int16 celNo = GET_SEL32V(_segMan, object, SELECTOR(cel));
+ if (viewId == 0xFFFF) // invalid view
+ return;
+
GfxView *tmpView = _cache->getView(viewId);
Common::Rect celRect;