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
1 changed files with 4 additions and 2 deletions

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;