From: Perttu Ahola Date: Tue, 18 Oct 2011 16:53:34 +0000 (+0300) Subject: Fix possible NULL dereference in MobV2CAO::step X-Git-Tag: 0.3.dev-20111021~9 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=28f2fdb6dec0c54ce9e32df79a73ef19aee03fd5;hp=4e1055543c01af8f17f1ab2e742922575170251e;p=oweals%2Fminetest.git Fix possible NULL dereference in MobV2CAO::step --- diff --git a/src/content_cao.cpp b/src/content_cao.cpp index 67594eb9f..6cb2cee38 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -1000,6 +1000,8 @@ void MobV2CAO::step(float dtime, ClientEnvironment *env) if(m_sprite_type == "humanoid_1"){ scene::ICameraSceneNode* camera = m_node->getSceneManager()->getActiveCamera(); + if(!camera) + return; v3f cam_to_mob = m_node->getAbsolutePosition() - camera->getAbsolutePosition(); cam_to_mob.normalize(); int col = 0;