From 48c8c2a8c3f09057fccdab1cafc3a13f6b8172b1 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 26 Jan 2019 16:58:25 +0000 Subject: [PATCH 1/2] ItemFrame: address crashdump 2113950 thanks Mojang for designing this lovely system where so much undefined behaviour is able to take place :( --- src/pocketmine/block/ItemFrame.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/block/ItemFrame.php b/src/pocketmine/block/ItemFrame.php index 0330367ec..e7b704b31 100644 --- a/src/pocketmine/block/ItemFrame.php +++ b/src/pocketmine/block/ItemFrame.php @@ -65,7 +65,7 @@ class ItemFrame extends Flowable{ 2 => Vector3::SIDE_NORTH, 3 => Vector3::SIDE_SOUTH ]; - if(!$this->getSide($sides[$this->meta])->isSolid()){ + if(isset($sides[$this->meta]) and !$this->getSide($sides[$this->meta])->isSolid()){ $this->level->useBreakOn($this); } } From 9826abd83e646a41826b5531c2ab9a1844cb4a27 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 26 Jan 2019 16:59:03 +0000 Subject: [PATCH 2/2] Stair: fixed crash if player is null --- src/pocketmine/block/Stair.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/block/Stair.php b/src/pocketmine/block/Stair.php index e45e25482..cf9328aac 100644 --- a/src/pocketmine/block/Stair.php +++ b/src/pocketmine/block/Stair.php @@ -89,7 +89,7 @@ abstract class Stair extends Transparent{ 2 => 1, 3 => 3 ]; - $this->meta = $faces[$player->getDirection()] & 0x03; + $this->meta = $player !== null ? $faces[$player->getDirection()] & 0x03 : 0; if(($clickVector->y > 0.5 and $face !== Vector3::SIDE_UP) or $face === Vector3::SIDE_DOWN){ $this->meta |= 0x04; //Upside-down stairs }