1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-18 12:33:17 +01:00

Fix #9919: invalid read in vehicle_update_measurements (#10300)

This commit is contained in:
Ted John
2019-11-27 20:45:32 +00:00
committed by Michael Steenbeek
parent 0093105219
commit 569161902f

View File

@@ -1537,8 +1537,10 @@ static void vehicle_update_measurements(rct_vehicle* vehicle)
return;
}
uint8_t stationId = ride->current_test_station;
if (!ride_get_entrance_location(ride, stationId).isNull())
if (ride->current_test_station == 0xFF)
return;
if (!ride_get_entrance_location(ride, ride->current_test_station).isNull())
{
uint8_t test_segment = ride->current_test_segment;