From d48463d2be1b63b970cfe03b85d0f4effdd205ad Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 9 Nov 2025 08:21:55 +0000 Subject: [PATCH] Fix #14763: Crash if NewGRF currency separator is not valid. (#14764) Ensure separator is a valid string. --- src/newgrf/newgrf_act0_globalvar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/newgrf/newgrf_act0_globalvar.cpp b/src/newgrf/newgrf_act0_globalvar.cpp index b71fccfb9b..18aa6d67a9 100644 --- a/src/newgrf/newgrf_act0_globalvar.cpp +++ b/src/newgrf/newgrf_act0_globalvar.cpp @@ -178,6 +178,7 @@ static ChangeInfoResult GlobalVarChangeInfo(uint first, uint last, int prop, Byt if (curidx < CURRENCY_END) { _currency_specs[curidx].separator.clear(); _currency_specs[curidx].separator.push_back(GB(options, 0, 8)); + StrMakeValidInPlace(_currency_specs[curidx].separator); /* By specifying only one bit, we prevent errors, * since newgrf specs said that only 0 and 1 can be set for symbol_pos */ _currency_specs[curidx].symbol_pos = GB(options, 8, 1);