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

grisenti noreply at scummvm.org
Wed Oct 11 15:15:32 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:
ed2726a526 HPL1: Fix out of bounds string access


Commit: ed2726a526ebfa08bed18b6f7f25121e82519186
    https://github.com/scummvm/scummvm/commit/ed2726a526ebfa08bed18b6f7f25121e82519186
Author: grisenti (emanuele at grisenti.net)
Date: 2023-10-11T17:14:58+02:00

Commit Message:
HPL1: Fix out of bounds string access

Changed paths:
    engines/hpl1/penumbra-overture/Credits.cpp


diff --git a/engines/hpl1/penumbra-overture/Credits.cpp b/engines/hpl1/penumbra-overture/Credits.cpp
index d7d5ad82726..4ef03c3a290 100644
--- a/engines/hpl1/penumbra-overture/Credits.cpp
+++ b/engines/hpl1/penumbra-overture/Credits.cpp
@@ -91,7 +91,7 @@ void cCredits::OnDraw() {
 	float fY = mfYPos;
 	for (size_t i = 0; i < mvTextRows.size(); ++i) {
 		int lSize = 0;
-		if (mvTextRows[i][0] == '*') {
+		if (!mvTextRows[i].empty() && mvTextRows[i][0] == '*') {
 			lSize = 1;
 		}
 		if (mvTextRows[i].size() <= 1) {
@@ -128,7 +128,7 @@ void cCredits::Update(float afTimeStep) {
 	float fY = mfYPos;
 	for (size_t i = 0; i < mvTextRows.size(); ++i) {
 		int lSize = 0;
-		if (mvTextRows[i][0] == '*')
+		if (!mvTextRows[i].empty() && mvTextRows[i][0] == '*')
 			lSize = 1;
 		if (mvTextRows[i].size() <= 1)
 			fY += fSize[lSize];




More information about the Scummvm-git-logs mailing list