[Scummvm-git-logs] scummvm master -> d053c8b494d6bcd6b225089b5f44c7d7eb361161

alxpnv a04198622 at gmail.com
Mon May 31 12:00:44 UTC 2021


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:
d053c8b494 ASYLUM: fix save slot index out of range


Commit: d053c8b494d6bcd6b225089b5f44c7d7eb361161
    https://github.com/scummvm/scummvm/commit/d053c8b494d6bcd6b225089b5f44c7d7eb361161
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2021-05-31T15:02:59+03:00

Commit Message:
ASYLUM: fix save slot index out of range

Changed paths:
    engines/asylum/views/menu.cpp


diff --git a/engines/asylum/views/menu.cpp b/engines/asylum/views/menu.cpp
index bebf477ad8..ae0273eda5 100644
--- a/engines/asylum/views/menu.cpp
+++ b/engines/asylum/views/menu.cpp
@@ -1639,6 +1639,9 @@ void Menu::clickLoadGame() {
 	int32 index = 0;
 	for (int32 y = 150; y < 324; y += 29) {
 		if (cursor.x >= 350) {
+			if (index + _startIndex + 6 > 24)
+				break;
+
 			snprintf((char *)&text, sizeof(text), "%d. %s", index + _startIndex + 7, getSaveLoad()->getName((uint32)(index + _startIndex + 6)).c_str());
 
 			if (cursor.x <= (350 + getText()->getWidth((char *)&text))
@@ -1654,6 +1657,9 @@ void Menu::clickLoadGame() {
 				break;
 			}
 		} else if (cursor.x >= 30) {
+			if (index + _startIndex > 24)
+				break;
+
 			snprintf((char *)&text, sizeof(text), "%d. %s", index + _startIndex + 1, getSaveLoad()->getName((uint32)(index + _startIndex)).c_str());
 
 			if (cursor.x <= (30 + getText()->getWidth((char *)&text))
@@ -1735,6 +1741,9 @@ void Menu::clickSaveGame() {
 	int32 index = 0;
 	for (int16 y = 150; y < 324; y += 29) {
 		if (cursor.x >= 350) {
+			if (index + _startIndex + 6 > 24)
+				break;
+
 			snprintf((char *)&text, sizeof(text), "%d. %s", index + _startIndex + 7, getSaveLoad()->getName((uint32)(index + _startIndex + 6)).c_str());
 
 			if (cursor.x <= (350 + getText()->getWidth((char *)&text))
@@ -1758,6 +1767,9 @@ void Menu::clickSaveGame() {
 				break;
 			}
 		} else if (cursor.x >= 30) {
+			if (index + _startIndex > 24)
+				break;
+
 			snprintf((char *)&text, sizeof(text), "%d. %s", index + _startIndex + 1, getSaveLoad()->getName((uint32)(index + _startIndex)).c_str());
 
 			if (cursor.x <= (30 + getText()->getWidth((char *)&text))
@@ -1843,6 +1855,9 @@ void Menu::clickDeleteGame() {
 	int32 index = 0;
 	for (int16 y = 150; y < 324; y += 29) {
 		if (cursor.x >= 350) {
+			if (index + _startIndex + 6 > 24)
+				break;
+
 			snprintf((char *)&text, sizeof(text), "%d. %s", index + _startIndex + 7, getSaveLoad()->getName((uint32)(index + _startIndex + 6)).c_str());
 
 			if (cursor.x <= (350 + getText()->getWidth((char *)&text))
@@ -1858,6 +1873,9 @@ void Menu::clickDeleteGame() {
 				break;
 			}
 		} else if (cursor.x >= 30) {
+			if (index + _startIndex > 24)
+				break;
+
 			snprintf((char *)&text, sizeof(text), "%d. %s", index + _startIndex + 1, getSaveLoad()->getName((uint32)(index + _startIndex)).c_str());
 
 			if (cursor.x <= (30 + getText()->getWidth((char *)&text))




More information about the Scummvm-git-logs mailing list