aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsluicebox2019-04-30 17:46:33 -0700
committerFilippos Karapetis2019-05-01 14:53:23 +0300
commit67908559167844a1a207d1544dfcdbd8f8ca1260 (patch)
treec8478e32f689aa8e9d58851f96afcd83af0637ec
parentc572828132eb9c5dfbb4b596a663e95f25357ee0 (diff)
downloadscummvm-rg350-67908559167844a1a207d1544dfcdbd8f8ca1260.tar.gz
scummvm-rg350-67908559167844a1a207d1544dfcdbd8f8ca1260.tar.bz2
scummvm-rg350-67908559167844a1a207d1544dfcdbd8f8ca1260.zip
SCI: Handle recursive view loop references
Fixes bug #10953 in FPFP
-rw-r--r--engines/sci/graphics/view.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index 014ddb1281..5924571660 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -286,10 +286,15 @@ void GfxView::initData(GuiResourceId resourceId) {
seekEntry = loopData[0];
if (seekEntry != 255) {
- if (seekEntry >= loopCount)
- error("Bad loop-pointer in sci 1.1 view");
_loop[loopNo].mirrorFlag = true;
- loopData = _resource->subspan(headerSize + (seekEntry * loopSize));
+
+ // use the root loop for mirroring. this handles rare loops that
+ // mirror loops that mirror loops. (FPFP view 844, bug #10953)
+ do {
+ if (seekEntry >= loopCount)
+ error("Bad loop-pointer in sci 1.1 view");
+ loopData = _resource->subspan(headerSize + (seekEntry * loopSize));
+ } while ((seekEntry = loopData[0]) != 255);
} else {
_loop[loopNo].mirrorFlag = false;
}