diff options
author | sluicebox | 2019-04-30 17:46:33 -0700 |
---|---|---|
committer | Filippos Karapetis | 2019-05-01 14:53:23 +0300 |
commit | 67908559167844a1a207d1544dfcdbd8f8ca1260 (patch) | |
tree | c8478e32f689aa8e9d58851f96afcd83af0637ec /engines/sci/graphics | |
parent | c572828132eb9c5dfbb4b596a663e95f25357ee0 (diff) | |
download | scummvm-rg350-67908559167844a1a207d1544dfcdbd8f8ca1260.tar.gz scummvm-rg350-67908559167844a1a207d1544dfcdbd8f8ca1260.tar.bz2 scummvm-rg350-67908559167844a1a207d1544dfcdbd8f8ca1260.zip |
SCI: Handle recursive view loop references
Fixes bug #10953 in FPFP
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/view.cpp | 11 |
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; } |