[Scummvm-git-logs] scummvm master -> a87e025c765c2dd0e3139c7f7708f8bb00a4a35e
eriktorbjorn
noreply at scummvm.org
Sat May 3 16:41:07 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
a87e025c76 SCUMM: Clean up comment about string bounds checking
Commit: a87e025c765c2dd0e3139c7f7708f8bb00a4a35e
https://github.com/scummvm/scummvm/commit/a87e025c765c2dd0e3139c7f7708f8bb00a4a35e
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-05-03T18:40:47+02:00
Commit Message:
SCUMM: Clean up comment about string bounds checking
Changed paths:
engines/scumm/script_v5.cpp
diff --git a/engines/scumm/script_v5.cpp b/engines/scumm/script_v5.cpp
index 77b9f1f38bf..ca65110b13d 100644
--- a/engines/scumm/script_v5.cpp
+++ b/engines/scumm/script_v5.cpp
@@ -3054,16 +3054,16 @@ void ScummEngine_v5::o5_stringOps() {
byte *ptr;
int len;
- // For at the very least "get string char" we need to do bounds checking
- // because the copy protection script in floppy versions of Fate of
- // Atlantis has a bug that causes it to access the string at a negative
- // position. In that case we should technically return 48 (the ASCII
- // code for "0"), but anything outside the 49-56 should be fine. See
- // bug #15884 for further details.
+ // We do bounds checking on get/set string char to catch misbehaving
+ // scripts. Known cases so far:
//
- // VGA Loom writes out of bounds on startup, but we allow it since it's
- // still within the additional 2 bytes that gets allocated for each
- // resources as a "safety area".
+ // * Fate of Atlantis, the copy protection screen. This will read from
+ // a negative index if the mouse cursor is moved to the top of the
+ // screen. Technically we should return 48 (ASCII for "0"), but
+ // anything outside the 49-56 range is fine. See bug #15884.
+ //
+ // * VGA Loom writes one byte past the end of a string on startup, but
+ // this is within the "safety area" so it's ok.
_opcode = fetchScriptByte();
switch (_opcode & 0x1F) {
More information about the Scummvm-git-logs
mailing list