Skip to content

Commit

Permalink
Merge pull request godotengine#51185 from timothyqiu/tile-data-enum-r…
Browse files Browse the repository at this point in the history
…ange

Validate TileData enum range before using it as index
  • Loading branch information
akien-mga authored Aug 2, 2021
2 parents 5360c20 + 091d802 commit 2db45b6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scene/resources/tile_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3789,6 +3789,7 @@ int TileData::get_terrain_set() const {
}

void TileData::set_peering_bit_terrain(TileSet::CellNeighbor p_peering_bit, int p_terrain_index) {
ERR_FAIL_INDEX(p_peering_bit, TileSet::CellNeighbor::CELL_NEIGHBOR_MAX);
ERR_FAIL_COND(terrain_set < 0);
ERR_FAIL_COND(p_terrain_index < -1);
if (tile_set) {
Expand Down

0 comments on commit 2db45b6

Please sign in to comment.