Fix another out of bound buffer read in viewport map mode.

Drawing of non-company tunnels/bridges.
Caught by AddressSanitizer.
This commit is contained in:
Jonathan G Rennison
2015-11-22 23:30:09 +00:00
parent e91b84753b
commit d2cd74223e

View File

@@ -2297,7 +2297,7 @@ static void ViewportMapDrawBridgeTunnel(const ViewPort * const vp, const TunnelB
TileIndex tile = tbtm->from_tile;
const Owner o = GetTileOwner(tile);
if (!_legend_land_owners[_company_to_list_pos[o]].show_on_map) return;
if (o < MAX_COMPANIES && !_legend_land_owners[_company_to_list_pos[o]].show_on_map) return;
uint8 colour;
if (vp->map_type == VPMT_OWNER && _settings_client.gui.use_owner_colour_for_tunnelbridge && o < MAX_COMPANIES) {