Commit 6ff5c3f
authored
Fix out-of-bounds theme-color read for the special 7th race circuit (#16)
The single-race and circuit-race screens expose 7 selectable circuits, but
g_singleRaceVisualStateMap only encodes the 6 standard ones (24 = 6 * 4). Both
callers pass circuitIndex * 4 + raceIndex, so selecting the special 7th circuit
(cf. the m_circuitIndex != 6 special-casing in CircuitRaceScreen::Update) yields
index 24..27 and reads past the table.
This is a latent bug in the retail binary, verified byte-matching with reccmp
(ApplyThemeColor/CreateWidgets/WrapIndex 100%, UpdateRacePreview/ScrollPrevious
100% effective, datacmp 0 issues). Retail happened to read harmless adjacent
static data, but the port trips ASAN/UBSAN.
Guard the lookup in ApplyThemeColor (the shared choke point) and give the
special circuit a dark purple border.1 parent 163c47a commit 6ff5c3f
1 file changed
Lines changed: 9 additions & 0 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
186 | 195 | | |
187 | 196 | | |
0 commit comments