1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 09:09:09 +00:00

Fix #12917: Write to negative array index for some string patterns.

Don't popped closed pair from the parenthesis stack a second time.
This commit is contained in:
2024-09-06 12:08:19 +01:00
committed by Peter Nelson
parent 33a7e9e512
commit a241ef8da0

View File

@@ -184,13 +184,6 @@ UBool ScriptRun::next()
parenStack[++startSP].scriptCode = scriptCode; parenStack[++startSP].scriptCode = scriptCode;
} }
} }
// if this character is a close paired character,
// pop it from the stack
if (pairIndex >= 0 && (pairIndex & 1) != 0 && parenSP >= 0) {
parenSP -= 1;
startSP -= 1;
}
} else { } else {
// if the run broke on a surrogate pair, // if the run broke on a surrogate pair,
// end it before the high surrogate // end it before the high surrogate