From 359cc9aa991080b24020d84b89be24ba98131848 Mon Sep 17 00:00:00 2001 From: Duncan Frost Date: Thu, 29 Jan 2015 17:47:35 +0000 Subject: [PATCH] Add upper bounds --- src/world/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world/map.c b/src/world/map.c index d6693ba64c..adc0f219e3 100644 --- a/src/world/map.c +++ b/src/world/map.c @@ -88,7 +88,7 @@ void map_element_iterator_restart_for_tile(map_element_iterator *it) rct_map_element *map_get_first_element_at(int x, int y) { - if (x < 0 || y < 0) + if (x < 0 || y < 0 || x > 255 || y > 255) { log_error("Trying to access element outside of range"); return NULL;