[Scummvm-git-logs] scummvm master -> e97a4ac06a6a8779a76524af7b3750a4e1002269
tag2015
noreply at scummvm.org
Thu Jun 1 13:12:27 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e97a4ac06a AGS: Add sanity check for frame in turning animation
Commit: e97a4ac06a6a8779a76524af7b3750a4e1002269
https://github.com/scummvm/scummvm/commit/e97a4ac06a6a8779a76524af7b3750a4e1002269
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2023-06-01T14:57:50+02:00
Commit Message:
AGS: Add sanity check for frame in turning animation
Before checking if an animation frame is not used (numFrames < 1),
make sure that the addressed frame is actually present in the loops vector.
Fixes #14491 affecting blackwell2, mountainsofmadness and possibly others
Changed paths:
engines/ags/engine/ac/character.cpp
diff --git a/engines/ags/engine/ac/character.cpp b/engines/ags/engine/ac/character.cpp
index d200722a77f..66dd33f8743 100644
--- a/engines/ags/engine/ac/character.cpp
+++ b/engines/ags/engine/ac/character.cpp
@@ -1711,7 +1711,11 @@ void start_character_turning(CharacterInfo *chinf, int useloop, int no_diagonal)
break;
if ((turnlooporder[ii] >= 4) && (no_diagonal > 0))
continue;
- if (_GP(views)[chinf->view].loops[turnlooporder[ii]].numFrames < 1)
+ // Upstream does not do this check
+ // The value of turnlooporder should be checked before addressing the
+ // loops vector, to avoid going OOB and triggering an assertion
+ if (((uint)turnlooporder[ii] < _GP(views)[chinf->view].loops.size()) &&
+ (_GP(views)[chinf->view].loops[turnlooporder[ii]].numFrames < 1))
continue;
if (turnlooporder[ii] < _GP(views)[chinf->view].numLoops)
chinf->walking += TURNING_AROUND;
More information about the Scummvm-git-logs
mailing list