[Scummvm-git-logs] scummvm master -> 03d1631b6356759d2161eec7fa1ac2ab2a83b8f1

AndywinXp noreply at scummvm.org
Mon Aug 12 11:31:52 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:
03d1631b63 SCUMM: Avoid erroring out on invalid control codes


Commit: 03d1631b6356759d2161eec7fa1ac2ab2a83b8f1
    https://github.com/scummvm/scummvm/commit/03d1631b6356759d2161eec7fa1ac2ab2a83b8f1
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-08-12T13:31:41+02:00

Commit Message:
SCUMM: Avoid erroring out on invalid control codes

This matches the actual behavior from every SCUMM version.
This should properly fix the crashes in #1675 and #2715.

Changed paths:
    engines/scumm/string.cpp


diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index cc9dcc73168..71871f8d6db 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -454,6 +454,8 @@ bool ScummEngine::handleNextCharsetCode(Actor *a, int *code) {
 			_nextTop -= _charset->getFontHeight() - oldy;
 			break;
 		default:
+			// We should never get here! Any invalid control code by this point
+			// has already been converted by a normal character to be displayed.
 			error("handleNextCharsetCode: invalid code %d", c);
 		}
 	}
@@ -1496,7 +1498,8 @@ int ScummEngine::convertMessageToString(const byte *msg, byte *dst, int dstSize)
 					}
 					break;
 				default:
-					error("convertMessageToString(): string escape sequence %d unknown", chr);
+					// Invalid control code. Just print the character...
+					*dst++ = chr;
 				}
 				num += (_game.version == 8) ? 4 : 2;
 			}




More information about the Scummvm-git-logs mailing list