From b3454b34881771be3c982f5e639e94eb222dfb8b Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 16 May 2020 18:42:47 +0100 Subject: [PATCH] BiomeArray: check lower bounds in ::idx() as well as upper bounds --- src/world/format/BiomeArray.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world/format/BiomeArray.php b/src/world/format/BiomeArray.php index f2e07d0d2..ca91fbea0 100644 --- a/src/world/format/BiomeArray.php +++ b/src/world/format/BiomeArray.php @@ -43,7 +43,7 @@ final class BiomeArray{ } private static function idx(int $x, int $z) : int{ - if($x >= 16 or $z >= 16){ + if($x < 0 or $x >= 16 or $z < 0 or $z >= 16){ throw new \InvalidArgumentException("x and z must be in the range 0-15"); } return ($z << 4) | $x;