ASAN: fix another array bound problem...
This commit is contained in:
@@ -273,8 +273,12 @@ void update_explored(location dest) {
|
||||
bool is_blocked(location to_check) {
|
||||
short gr;
|
||||
ter_num_t ter;
|
||||
|
||||
// ASAN: location can be bad if we are called by place_party
|
||||
if (to_check.x<0 || to_check.y<0)
|
||||
return true;
|
||||
if(is_out()) {
|
||||
if (to_check.x>=96 || to_check.y>=96) // checkme: maybe >=48
|
||||
return true;
|
||||
if(impassable(univ.out[to_check.x][to_check.y])) {
|
||||
return true;
|
||||
}
|
||||
@@ -288,6 +292,8 @@ bool is_blocked(location to_check) {
|
||||
}
|
||||
|
||||
if((is_town()) || (is_combat())) {
|
||||
if (to_check.x >= univ.town->max_dim || to_check.y >= univ.town->max_dim)
|
||||
return true;
|
||||
ter = univ.town->terrain(to_check.x,to_check.y);
|
||||
gr = univ.scenario.ter_types[ter].picture;
|
||||
|
||||
|
Reference in New Issue
Block a user