aboutsummaryrefslogtreecommitdiff
path: root/engines/access/animation.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-26 19:48:14 -0400
committerPaul Gilbert2016-07-26 19:48:14 -0400
commit504cf6ecb688a3f1c65a857bffd527d8b0e6ba63 (patch)
tree0c0d96d4061c11850c851f0fc981c75a58c20515 /engines/access/animation.cpp
parentd8c28d15ae553d047b7e571f98727fa79ee143f3 (diff)
parente19922d181e775791f9105b8be7ff410770ede51 (diff)
downloadscummvm-rg350-504cf6ecb688a3f1c65a857bffd527d8b0e6ba63.tar.gz
scummvm-rg350-504cf6ecb688a3f1c65a857bffd527d8b0e6ba63.tar.bz2
scummvm-rg350-504cf6ecb688a3f1c65a857bffd527d8b0e6ba63.zip
Merge branch 'master' into xeen
Diffstat (limited to 'engines/access/animation.cpp')
-rw-r--r--engines/access/animation.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/access/animation.cpp b/engines/access/animation.cpp
index 14d7c0d4cc..22de0fcb60 100644
--- a/engines/access/animation.cpp
+++ b/engines/access/animation.cpp
@@ -53,6 +53,18 @@ Animation::Animation(AccessEngine *vm, Common::SeekableReadStream *stream) : Man
uint32 startOfs = stream->pos();
_type = stream->readByte();
+
+ // WORKAROUND: In Amazon floppy English, there's an animation associated with
+ // the librarian that isn't used, and has junk data. Luckily, it's animation
+ // type is also invalid, so if the _type isn't in range, exit immediately
+ if (_type < 0 || _type > 7) {
+ _scaling = -1;
+ _frameNumber = -1;
+ _initialTicks = _countdownTicks = 0;
+ _loopCount = _currentLoopCount = 0;
+ return;
+ }
+
_scaling = stream->readSByte();
stream->readByte(); // unk
_frameNumber = stream->readByte();