[Scummvm-git-logs] scummvm master -> 6140c35b95db2f7af4abca81589d91e147830f10

sev- noreply at scummvm.org
Tue Nov 5 17:31:39 UTC 2024


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:
6140c35b95 QDENGINE: Fix potential out-of-bounds reads. CID 1564818, CID 1564844


Commit: 6140c35b95db2f7af4abca81589d91e147830f10
    https://github.com/scummvm/scummvm/commit/6140c35b95db2f7af4abca81589d91e147830f10
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-11-05T18:31:00+01:00

Commit Message:
QDENGINE: Fix potential out-of-bounds reads. CID 1564818, CID 1564844

Changed paths:
    engines/qdengine/qdcore/qd_animation.cpp
    engines/qdengine/qdcore/qd_game_object_moving.cpp


diff --git a/engines/qdengine/qdcore/qd_animation.cpp b/engines/qdengine/qdcore/qd_animation.cpp
index 61a18f405f1..fbc23eb7306 100644
--- a/engines/qdengine/qdcore/qd_animation.cpp
+++ b/engines/qdengine/qdcore/qd_animation.cpp
@@ -1236,7 +1236,7 @@ static const char *statusList[] = {
 };
 
 Common::String qdAnimation::status2str(int fl, bool truncate) {
-	if (fl > ARRAYSIZE(statusList) || fl < 0)
+	if (fl >= ARRAYSIZE(statusList) || fl < 0)
 		return Common::String::format("<%d>", fl);
 
 	return Common::String(&statusList[fl][truncate ? 13 : 0]);
diff --git a/engines/qdengine/qdcore/qd_game_object_moving.cpp b/engines/qdengine/qdcore/qd_game_object_moving.cpp
index e030e898e33..a5f13146999 100644
--- a/engines/qdengine/qdcore/qd_game_object_moving.cpp
+++ b/engines/qdengine/qdcore/qd_game_object_moving.cpp
@@ -2761,7 +2761,7 @@ static const char *movementList[] = {
 };
 
 Common::String qdGameObjectMoving::movement2str(int fl, bool truncate) {
-	if (fl > ARRAYSIZE(movementList) || fl < 0)
+	if (fl >= ARRAYSIZE(movementList) || fl < 0)
 		return Common::String::format("<%d>", fl);
 
 	return Common::String(&movementList[fl][truncate ? 14 : 0]);




More information about the Scummvm-git-logs mailing list