diff options
author | Eugene Sandulenko | 2007-09-01 15:03:44 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2007-09-01 15:03:44 +0000 |
commit | 2d729927c59f6a380a6671b21d5809ff321467da (patch) | |
tree | 56ae51dc412db2d6f3718946741367a34c00fa25 /engines | |
parent | 7f08865ec5f6ff350282a219cdccd26714f33f59 (diff) | |
download | scummvm-rg350-2d729927c59f6a380a6671b21d5809ff321467da.tar.gz scummvm-rg350-2d729927c59f6a380a6671b21d5809ff321467da.tar.bz2 scummvm-rg350-2d729927c59f6a380a6671b21d5809ff321467da.zip |
Do not decode frames beyond maxFrames to avoid any potential issues
svn-id: r28788
Diffstat (limited to 'engines')
-rw-r--r-- | engines/saga/animation.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp index 4dd24cb422..64e8b0a9c1 100644 --- a/engines/saga/animation.cpp +++ b/engines/saga/animation.cpp @@ -829,8 +829,12 @@ int Anim::fillFrameOffsets(AnimationData *anim, bool reallyFill) { readS._bigEndian = !_vm->isBigEndian(); // RLE has inversion BE<>LE while (!readS.eos()) { - if (reallyFill && currentFrame <= anim->maxFrame) + if (reallyFill) { anim->frameOffsets[currentFrame] = readS.pos(); + + if (currentFrame == anim->maxFrame) + break; + } currentFrame++; // For some strange reason, the animation header is in little |